Detection result determination method and device, storage medium and electronic device
By creating target detection services and associated detection tasks on the target computing platform, the problem of low detection efficiency in railway inspection was solved, and efficient determination of image detection results was achieved.
Patent Information
- Application Number
- CN202310021770.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-06
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-01-06
AI Technical Summary
In existing technologies, image detection in railway inspection scenarios requires a large amount of manual operation, resulting in low detection efficiency and an inability to efficiently determine detection results.
By creating target detection services and associated detection tasks on the target computing platform, image detection is achieved using front-end services and back-end controllers. Multi-task load balancing is supported, and the number of service replicas is dynamically adjusted to optimize detection efficiency.
It simplifies the manual inspection process, improves the efficiency of determining inspection results, and achieves load balancing and efficient image inspection.
Smart Images

Figure CN115937202B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for determining detection results, a storage medium, and an electronic device. Background Technology
[0002] Currently, in the field of computer graphics, with the continuous improvement of image recognition technology, users have increasingly higher requirements for the realization of automatic image detection. Typically, in a railway inspection scenario, in order to detect the condition of a railway section, inspection personnel usually patrol the railway section. Inspection tasks can include: track inspection, electrical inspection, etc. Then, maintenance personnel acquire the image to be detected of the section, and then use an image processor to perform offline recognition, segmentation, classification and detection of the image to obtain the detection result. However, this method requires a large number of experienced maintenance personnel to operate, which consumes manpower and resources, and is often too time-consuming and has low detection efficiency.
[0003] Therefore, in related technologies, there is a technical problem of how to improve the efficiency of determining detection results. Summary of the Invention
[0004] This application provides a method, apparatus, storage medium, and electronic device for determining detection results, in order to at least address the problem of how to improve the efficiency of determining detection results in related technologies.
[0005] According to one embodiment of this application, a method for determining a detection result is provided, comprising: in response to a service creation request sent by a front-end service of a target computing platform, creating a target detection service through a back-end controller of the target computing platform, wherein the target detection service is used to execute a created detection task; if the target detection service is successfully created, in response to a first task creation request sent by the front-end service, creating a first detection task associated with the target detection service through the back-end controller, wherein the first detection task is used to detect objects of a first type; acquiring a first image sent by the front-end service, performing a first detection task on the first image through the target detection service to obtain a first detection result, wherein the first detection result is used to indicate whether an object of the first type is detected in the first image; and sending the first detection result to the front-end service.
[0006] In one exemplary embodiment, the method further includes: upon successful creation of the target detection service, in response to a second task creation request sent by the front-end service, creating a second detection task associated with the target detection service through the back-end controller, wherein the second detection task is used to detect objects of a second type; acquiring a second image sent by the front-end service, performing the second detection task on the second image through the target detection service to obtain a second detection result, wherein the second detection result is used to indicate whether objects of the second type are detected in the second image; and sending the second detection result to the front-end service.
[0007] In an exemplary embodiment, when the target detection service has multiple service replicas, performing a first detection task on the first image through the target detection service to obtain a first detection result includes: performing the first detection task on the first image through a first service replica that is in an idle state among the multiple service replicas to obtain the first detection result; performing a second detection task on the second image through the target detection service to obtain a second detection result includes: performing the second detection task on the second image through a second service replica that is in an idle state among the multiple service replicas to obtain the second detection result.
[0008] In one exemplary embodiment, the method further includes: if the target detection service is successfully created, in response to a second task creation request sent by the front-end service, creating a second detection task associated with the target detection service through the back-end controller, wherein the second detection task is used to detect a second type of object; if the first image sent by the front-end service is obtained, performing the second detection task on the first image through the target detection service to obtain a third detection result, wherein the third detection result is used to indicate whether a second type of object is detected in the first image; and sending the third detection result to the front-end service.
[0009] In an exemplary embodiment, the method further includes: after creating the target detection service, creating a service replica scaling service corresponding to the target detection service, wherein the service replica scaling service is used to adjust the number of service replicas of the target detection service, and the service replicas of the target detection service are used to execute the created detection task; when it is detected that the number of service replicas of the target detection service needs to be adjusted, the first group of service replicas currently possessed by the target detection service is adjusted to a second group of service replicas through the service replica scaling service, wherein the number of service replicas in the first group of service replicas and the second group of service replicas is different; and the service replicas in the second group of service replicas are respectively scheduled to the target image server in a group of image processors corresponding to the backend controller, wherein the service replicas in the second group of service replicas are used to call the target image server to execute the image processing operation in the corresponding detection task when executing the corresponding detection task.
[0010] In an exemplary embodiment, before adjusting the first group of service replicas currently possessed by the target detection service to the second group of service replicas through the service replica scaling service when it is detected that the number of service replicas of the target detection service needs to be adjusted, the method further includes: obtaining the number of detection tasks associated with the target detection service created within a predetermined time period; and determining whether the number of service replicas of the target detection service needs to be adjusted based on the obtained number of detection tasks.
[0011] In an exemplary embodiment, adjusting the first group of service replicas currently possessed by the target detection service to a second group of service replicas through the service replica scaling service includes: when the number of detection tasks obtained is greater than a preset number threshold, adjusting the first group of service replicas currently possessed by the target detection service to a second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is less than the number of service replicas in the second group of service replicas; when the number of detection tasks obtained is less than or equal to the preset number threshold, adjusting the first group of service replicas currently possessed by the target detection service to a second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is greater than the number of service replicas in the second group of service replicas.
[0012] In an exemplary embodiment, the step of creating a target detection service through the backend controller of the target computing platform in response to a service creation request sent by the frontend service of the target computing platform includes: obtaining first service information, central processing unit information, and memory information from the service creation request; and, provided that the first service information provides the namespace, name, mirror information, and copy information of the target detection service, creating the target detection service based on the namespace, name, mirror information, copy information, central processing unit information, and memory information of the target detection service; wherein the central processing unit information represents the processing capacity of the target detection service, and the memory information represents the storage space occupied by the target detection service.
[0013] In one exemplary embodiment, the method further includes: obtaining first response information sent by the backend controller after creating the target detection service; and determining that the target detection service has been successfully created if the first response information contains second service information; wherein the second service information includes at least one of the following: the service code of the target detection service, the indication information of the target detection service, the service number of the target detection service, the Uniform Resource Locator (URL) of the target detection service, the running status of the target detection service, the creation time of the target detection service, and the update time of the target detection service; wherein the service code of the target detection service is used to indicate the creation status of the target detection service, whether the indication information of the target detection service is empty is used to indicate whether the target detection service has been successfully created, the service number of the target detection service is the unique identifier of the target detection service, and the URL of the target detection service is the receiving address when receiving the image sent by the frontend service.
[0014] In one exemplary embodiment, the method further includes: obtaining second response information sent by the backend controller after creating the first detection task; determining that the first detection task was successfully created if the second response information contains task information; wherein the task information includes at least one of the following: the task code of the first detection task, the indication information of the first detection task, the task number of the first detection task, the creation time of the first detection task, and the update time of the first detection task; wherein the task code of the first detection task is used to indicate the creation status of the first detection task, whether the indication information of the first detection task is empty is used to indicate whether the first detection task was successfully created, and the task number of the first detection task is a unique identifier of the first detection task.
[0015] According to another embodiment of this application, a device for determining detection results is provided, comprising: a first creation module, configured to create a target detection service through a backend controller of the target computing platform in response to a service creation request sent by a frontend service of the target computing platform, wherein the target detection service is used to execute a created detection task; a second creation module, configured to, upon successful creation of the target detection service, create a first detection task associated with the target detection service through the backend controller in response to a first task creation request sent by the frontend service, wherein the first detection task is used to detect objects of a first type; an execution module, configured to acquire a first image sent by the frontend service, execute a first detection task on the first image through the target detection service, and obtain a first detection result, wherein the first detection result is used to indicate whether an object of the first type is detected in the first image; and a sending module, configured to send the first detection result to the frontend service.
[0016] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0017] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0018] This application, based on a target computing platform, utilizes a front-end service and a back-end controller. The front-end service initiates a request to create a detection task, and the back-end controller creates a first detection task associated with the target detection service. Executing this first detection task enables the detection of a first image. In railway inspection scenarios, this simplifies the manual image inspection process, reduces tedious operations, and allows for load balancing when multiple detection tasks are present, maximizing the efficiency of the detection service. Therefore, it solves the problem of improving the efficiency of detection result determination, achieving the desired effect. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for determining detection results according to an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of the architecture of the target computing platform according to an embodiment of this application;
[0021] Figure 3This is a schematic diagram illustrating a usage scenario of the target computing platform according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the software architecture of the AI Station backend according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram showing the distribution of copies of the target detection service according to an embodiment of this application;
[0024] Figure 6 This is a schematic diagram of the structure of the device for determining the detection results according to an embodiment of this application. Detailed Implementation
[0025] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0027] The technical terms used in this application will be explained below:
[0028] Pod: Also known as a replica, it is the smallest schedulable unit in Kubernetes that performs specific computational operations.
[0029] Kubernetes is a portable, scalable, open-source platform for managing containerized workloads and services, facilitating declarative configuration and automation.
[0030] Front-end services: Terminal hardware, operating systems, and software that interact directly with users.
[0031] Backend services: server hardware, operating system, and software that processes user requests.
[0032] Controller: A service deployed in the AI Station backend cluster, responsible for managing target detection services and detection tasks.
[0033] Object detection service: A service deployed in the AI Station backend cluster, responsible for image detection.
[0034] Detection task: The client initiates a detection task, sends images to the AI Station object detection service, and retrieves the results.
[0035] GPU: Generally refers to Graphics Processing Unit. A graphics processing unit is a microprocessor specifically designed for performing image and graphics-related calculations in personal computers, workstations, game consoles, and some mobile devices.
[0036] Node: Kubernetes node. A Node can be divided into Master and Node, where Master is the management node and Node is the compute node.
[0037] The embodiments of this application can be run in Figure 1 On the target computing platform architecture shown, such as Figure 1 As shown, the network architecture includes: AI Station (artificial intelligence computing platform, equivalent to target computing platform) front-end service (referred to as front-end) and AI Station back-end controller (referred to as back-end). The hardware configuration of AI Station front-end is: CPU I7-4790K, memory 8G; the operating system of AI Station front-end is Windows 7SP1; the functions of AI Station front-end are briefly described as: reading images, sending HTTP requests, receiving HTTP responses, saving results, time recording, service operations, task operations, and query operations.
[0038] The hardware configuration of the AI Station backend is: 8*NVIDIA T4 GPUs; the operating system of the AI Station backend is: Ubuntu 16.04; the functions of the AI Station backend are: service management, task management, receiving HTTP requests, image detection, and sending HTTP responses.
[0039] The AI Station backend module is further divided into sub-modules based on function, including the AI Station controller, AI Station target detection service, image detection module, and HTTP server module.
[0040] The AI Station controller is responsible for creating services, updating services, deleting services, creating tasks, updating tasks, querying services, querying tasks, and querying resources.
[0041] The HTTP server module is responsible for receiving HTTP requests for image detection sent from the AI Station front end.
[0042] The image detection module is responsible for image preprocessing, detection, and postprocessing.
[0043] The detection service is an HTTP service deployed in the AI Station backend cluster. Each detection service can contain multiple replicas (Pods), and each replica runs a Docker container. Docker containers are started from different Docker images, each encapsulating a different AI model. These different AI models are used for different business scenarios; for example, overhead contact line 4C, track inspection, and electrical inspection are three different business scenarios, thus requiring different AI models. As for GPUs, each GPU can run different AI models, so there is no necessary correspondence between GPUs and AI models.
[0044] In one embodiment, the above Figure 1 The target computing platform can also be applied to edge offline inference scenarios such as railway inspection. For example... Figure 2 As shown, the user first initiates a service creation request through the AI Station frontend. The AI Station controller in the AI Station backend performs the service creation operations. Then, the user can initiate a detection task creation request through the AI Station frontend. The AI Station controller performs the task creation operations. Finally, the AI Station frontend transmits the task-related images to the AI Station object detection service and retrieves the detection results. All communication between the AI Station frontend and the AI Station backend modules uses the HTTP protocol.
[0045] The AI Station target computing platform can be understood as being built on Kubernetes container orchestration and computing resource discovery and scheduling capabilities. It supports the lifecycle management of containerized applications and microservice architecture, provides multiple ways to release inference services and continuous delivery capabilities, simplifies the inference service deployment process, and provides users with a stable, fast and flexible production environment service deployment platform.
[0046] This embodiment provides a method for determining the detection results running on the aforementioned target computing platform. Figure 3 This is a flowchart illustrating the determination of detection results according to embodiments of this application, such as... Figure 3 As shown, the process includes the following steps:
[0047] Step S302: In response to the service creation request sent by the front-end service of the target computing platform, a target detection service is created through the back-end controller of the target computing platform, wherein the target detection service is used to execute the created detection task;
[0048] Step S304: If the target detection service is successfully created, in response to the first task creation request sent by the front-end service, a first detection task associated with the target detection service is created through the back-end controller, wherein the first detection task is used to detect objects of a first type.
[0049] Step S306: Obtain the first image sent by the front-end service, perform a first detection task on the first image through the target detection service, and obtain a first detection result, wherein the first detection result is used to indicate whether the first type of object is detected in the first image;
[0050] Step S308: Send the first detection result to the front-end service.
[0051] Through the above steps, in response to a service creation request sent by the front-end service of the target computing platform, a target detection service is created by the back-end controller of the target computing platform. This target detection service is used to execute the created detection task. If the target detection service is successfully created, in response to a first task creation request sent by the front-end service, a first detection task associated with the target detection service for detecting a first type of object is created by the back-end controller. A first image sent by the front-end service is acquired, and the first detection task is executed on the first image by the target detection service to obtain a first detection result. The first detection result is then sent to the front-end service. This process addresses the problem of improving the efficiency of determining the detection result, thus achieving the effect of improving the efficiency of determining the detection result.
[0052] The entities that perform the above steps can be servers, terminals, etc., but are not limited to these.
[0053] Based on the above embodiments, a further technical solution is proposed, specifically including: when the target detection service is successfully created, in response to the second task creation request sent by the front-end service, creating a second detection task associated with the target detection service through the back-end controller, wherein the second detection task is used to detect a second type of object; acquiring a second image sent by the front-end service, performing the second detection task on the second image through the target detection service to obtain a second detection result, wherein the second detection result is used to indicate whether the second type of object is detected in the second image; and sending the second detection result to the front-end service.
[0054] It should be noted that the second type of object is different from the first type of object. For example, the first type of object can represent a dynamic object, while the second type of object is a static object. This application only distinguishes different detection tasks by limiting the first type and the second type, without making specific limitations on the first type and the second type.
[0055] In an exemplary embodiment, the process of performing a first detection task on the first image and obtaining a first detection result by means of the target detection service having multiple service replicas is described by the following steps: performing the first detection task on the first image by means of a first service replica that is in an idle state among the multiple service replicas, and obtaining the first detection result; performing a second detection task on the second image by means of the target detection service and obtaining a second detection result includes: performing the second detection task on the second image by means of a second service replica that is in an idle state among the multiple service replicas, and obtaining the second detection result.
[0056] Optionally, for the multiple service replicas in the above embodiments, all have the same execution level for the second image. When there are multiple idle second service replicas among the multiple service replicas, one can be selected to execute the second detection task.
[0057] In one exemplary embodiment, another technical solution is also proposed, specifically including: when the target detection service is successfully created, in response to the second task creation request sent by the front-end service, creating a second detection task associated with the target detection service through the back-end controller, wherein the second detection task is used to detect a second type of object; when the first image sent by the front-end service is obtained, performing the second detection task on the first image through the target detection service to obtain a third detection result, wherein the third detection result is used to indicate whether the second type of object is detected in the first image; and sending the third detection result to the front-end service.
[0058] In one exemplary embodiment, the following scheme is proposed, the implementation steps of which include: after creating the target detection service, creating a service replica scaling service corresponding to the target detection service, wherein the service replica scaling service is used to adjust the number of service replicas of the target detection service, and the service replicas of the target detection service are used to execute the created detection task; when it is detected that the number of service replicas of the target detection service needs to be adjusted, the first group of service replicas currently possessed by the target detection service is adjusted to a second group of service replicas through the service replica scaling service, wherein the number of service replicas in the first group of service replicas and the second group of service replicas are different; the service replicas in the second group of service replicas are respectively scheduled to the target image server in a group of image processors corresponding to the backend controller, wherein the service replicas in the second group of service replicas are used to call the target image server to execute the image processing operation in the corresponding detection task when executing the corresponding detection task.
[0059] In an exemplary embodiment, before adjusting the first group of service replicas currently possessed by the target detection service to the second group of service replicas through the service replica scaling service when it is detected that the number of service replicas of the target detection service needs to be adjusted, the following steps are also required: obtaining the number of detection tasks associated with the target detection service created within a predetermined time period; and determining whether the number of service replicas of the target detection service needs to be adjusted based on the obtained number of detection tasks.
[0060] In an exemplary embodiment, the process of adjusting the first group of service replicas currently possessed by the target detection service to the second group of service replicas through the service replica scaling service can be described by the following scheme: When the number of detection tasks obtained is greater than a preset number threshold, the first group of service replicas currently possessed by the target detection service is adjusted to the second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is less than the number of service replicas in the second group of service replicas; when the number of detection tasks obtained is less than or equal to the preset number threshold, the first group of service replicas currently possessed by the target detection service is adjusted to the second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is greater than the number of service replicas in the second group of service replicas.
[0061] In an exemplary embodiment, to better understand how the process of creating a target detection service in response to a service creation request sent by the front-end service of the target computing platform in step S302 is implemented, the following technical solution is proposed: First service information, CPU information, and memory information are obtained from the service creation request; Given that the first service information provides the namespace, name, mirror information, and copy information of the target detection service, the target detection service is created based on the namespace, name, mirror information, copy information, CPU information, and memory information of the target detection service; wherein the CPU information represents the processing capacity of the target detection service, and the memory information represents the storage space occupied by the target detection service.
[0062] In an exemplary embodiment, the creation result of the target detection service can be determined by the following scheme, specifically including: obtaining first response information sent by the backend controller after creating the target detection service; and determining that the target detection service has been successfully created if the first response information contains second service information. The second service information includes at least one of the following: the service code of the target detection service, the indication information of the target detection service, the service number of the target detection service, the Uniform Resource Locator (URL) of the target detection service, the running status of the target detection service, the creation time of the target detection service, and the update time of the target detection service. The service code of the target detection service indicates the creation status of the target detection service; whether the indication information of the target detection service is empty indicates whether the target detection service has been successfully created; the service number of the target detection service is the unique identifier of the target detection service; and the URL of the target detection service is the receiving address when receiving images sent by the frontend service.
[0063] In this embodiment, since corresponding service information can be generated during the creation of the target detection service, the success of the target detection service creation can be determined by the content of the service information contained in the response information.
[0064] In an exemplary embodiment, the following technical solution can be used to determine whether a detection task has been successfully created: obtaining second response information sent by the backend controller after creating the first detection task; determining that the first detection task has been successfully created if the second response information contains task information; wherein the task information includes at least one of the following: the task code of the first detection task, the indication information of the first detection task, the task number of the first detection task, the creation time of the first detection task, and the update time of the first detection task; wherein the task code of the first detection task is used to indicate the creation status of the first detection task, whether the indication information of the first detection task is empty is used to indicate whether the first detection task has been successfully created, and the task number of the first detection task is a unique identifier of the first detection task.
[0065] In this embodiment, since corresponding task information can be generated during the creation of the detection task, the success of the detection task creation can be determined by the content of the task information contained in the response information. For example, if the task code of the first detection task in the above task information indicates that the detection task creation failed, then the detection task was not created successfully.
[0066] It should be noted that, in the above embodiments, the task code of the first detection task can be set to Arabic numerals. For example, if the task code of the first detection task is determined to be 0, it can be determined that the first detection task was created successfully; if the task code of the first detection task is determined to be non-zero, it can be determined that the first detection task was created unsuccessfully. The indication information of the first detection task can be set to a string. For example, if the indication information of the first detection task is determined to be an empty string, it can be determined that the first detection task was created successfully; if the string of the first detection task is determined to contain garbled characters, it can be determined that the first detection task was created unsuccessfully.
[0067] The explanation process for the service code and instruction information of the target detection service can refer to the above explanation of the task code and instruction information of the first detection task, and will not be repeated here.
[0068] The following describes the process of querying based on the target computing platform's query function. In one embodiment, after creating a target detection service within the backend controller of the target computing platform, the system continues to acquire service query requests sent by the target object to the frontend interface of the target computing platform. These service query requests include the service ID of the target detection service, the namespace of the target detection service, the name of the target detection service, and the number of services that the target detection service is allowed to return. Based on the service query request, the backend controller queries the target detection service and sends the first query result to the frontend interface.
[0069] The first query result includes at least one of the following: the service code of the target detection service, the indication information of the target detection service, the service number of the target detection service, the namespace of the target detection service, the name of the target detection service, the mirror information of the target detection service, the copy information of the target detection service, the central processing unit information, the memory information, the Uniform Resource Locator of the target detection service, the running status of the target detection service, the creation time of the target detection service, and the update time of the target detection service.
[0070] Optionally, after creating a target detection service within the backend controller of the target computing platform, a task query request sent by the target object to the frontend interface of the target computing platform can be obtained. The task query request includes the task number of the detection task and the number of tasks that the detection task is allowed to return. Based on the service query request, the backend controller queries the target detection service and sends the second query result to the frontend interface.
[0071] The second query result includes at least one of the following: the task code of the detection task, the instruction information of the detection task, the task number of the detection task, the creation time of the detection task, the update time of the detection task, the service number of the target detection service, the namespace of the target detection service, the name of the target detection service, the Uniform Resource Locator of the target detection service, the image data to be detected, and the custom information of the target object.
[0072] In other embodiments, after creating a detection task corresponding to the target detection service in the backend controller according to the task creation request sent by the target object on the frontend interface, a service update request sent by the target object on the frontend interface is then obtained; the fourth service information of the target detection service is updated in the backend controller according to the service update request; wherein, the fourth service information includes at least the copy information of the target detection service.
[0073] Optionally, after creating a detection task corresponding to the target detection service in the backend controller based on the task creation request sent by the target object on the frontend interface, a service deletion request sent by the target object on the frontend interface can also be obtained; and the target detection service can be deleted in the backend controller based on the service deletion request.
[0074] Alternatively, after creating a detection task corresponding to the target detection service in the backend controller based on the task creation request sent by the target object in the frontend interface, a resource query request sent by the target object in the frontend interface can be obtained; the service resources of the target detection service can be queried in the backend controller according to the resource query request, and the third query result can be sent to the frontend interface.
[0075] The third query result includes at least one of the following: the service code of the target detection service, the indication information of the target detection service, the total cluster resources of the target detection service, the proportion of the total cluster resources occupied by the service resources of the running target detection service, and the remaining available resources of the total cluster resources.
[0076] In the above embodiments, the image detection process can be implemented as follows: using the TensorFlow machine learning framework and a neural network model for image analysis, the analysis steps are as follows:
[0077] Step 1: Identification: Identify the parts of interest, such as screws and fasteners, from the images sent by the AI Station front end;
[0078] Step 2, Segmentation: Segment the identified parts into smaller images;
[0079] Step 3, Classification: Classify each segmented part image, such as whether it is a screw, fastener, or other type of part;
[0080] Step 4: Inspection: Perform defect inspection on the classified part images to confirm whether the parts are in good condition or damaged.
[0081] Furthermore, in combination Figure 4 The software architecture of the AI Station backend will be explained, such as... Figure 4 As shown, the software modules of the AIStation backend controller are described below:
[0082] AI Station Controller: Responsible for service management, task management, and resource management operations;
[0083] Inference Service Controller: Responsible for operations such as creating and deleting AI Station object detection services (implemented through KFServing software);
[0084] Scaling and scaling service controller: Creates scaling and scaling services (equivalent to the service replica scaling and scaling services mentioned above) to support scaling and scaling of replicas based on QPS (implemented through KNative software);
[0085] Network Traffic Controller: Creates a traffic service. When the AI Station front end sends an image to the AI Station back end, the traffic will first reach the gateway of the network traffic controller, then the traffic service, and finally the AI Station object detection service (implemented through Istio software).
[0086] Cluster Controller: When the Inference Service Controller creates the AI Station object detection service, it creates a corresponding replica controller to control the number of replicas, and when a replica fails, it starts a new replica to replace it (implemented through Kubernetes software).
[0087] From a software module perspective, when the AI Station frontend sends a request to create a service to the AI Station backend, the processing flow between the AI Station frontend and backend can be described as follows:
[0088] Step 1: The AI Station front-end sends a request to create a service to the AI Station controller;
[0089] Step 2: After receiving the request, the AI Station controller stores the service creation information, then notifies the inference service controller, and returns a service creation success response after the following steps are successfully completed.
[0090] Step 3: The inference service controller creates the AI Station object detection service and notifies the scaling service controller.
[0091] Step 4: The scaling service controller creates a scaling service to support scaling replicas based on QPS and notifies the network traffic controller.
[0092] Step 5: The network traffic controller creates a traffic service and notifies the cluster controller;
[0093] Step 6: The cluster controller creates a replica controller;
[0094] Step 7: The replica controller creates the corresponding replica;
[0095] Step 8: The cluster controller schedules the replicas to a specific GPU (Graphics Processing Unit) on a specific server.
[0096] The scheduling strategy is as follows: The cluster controller pools the GPUs of all servers into a single GPU pool; each GPU in the pool is equal, and each GPU can run different AI models; the cluster controller stores information on GPUs currently running AI models and idle GPUs; when a replica needs to be scheduled, the cluster controller selects one from the idle GPUs; the scheduling process includes selection and binding. The selection process involves choosing servers and GPUs based on the replica's CPU, memory, and GPU requirements; binding refers to storing the replica and the selected GPU information and distributing the replica to the corresponding server and GPU; the selection process is serial and has a strict order, but the binding process is parallel and performed independently. This parallel binding ensures the concurrent scheduling performance of the cluster controller.
[0097] In one embodiment, when the AI Station frontend sends a request to create a task to the AI Station backend, the processing flow between the AI Station frontend and backend can be described as follows:
[0098] Step 1: The AI Station front end sends a request to create a task to the AI Station controller;
[0099] Step 2: After receiving the request to create a task, the AI Station controller stores the task information and then returns a response indicating that the task has been successfully created.
[0100] Step 3: The AI Station front end uses multi-threading to send images to the network traffic controller gateway in parallel;
[0101] Step 4: The network traffic controller gateway sends the image to the traffic service;
[0102] Step 5: The traffic service sends the image to the AI Station object detection service;
[0103] Step 6: The AI Station object detection service sends the image to a copy of the object detection service according to the load balancing strategy;
[0104] Step 7: Perform image detection on the copy and return the detection results;
[0105] Step 8: The AI Station front end receives the detection results and records them;
[0106] Step 9: Once all images have been detected, the AI Station front-end sends an update task request;
[0107] Step 10: After receiving the request to update the task, the AI Station controller updates the task information to the completed status.
[0108] Optionally, when users work using the AI Station target computing platform, the process is as follows:
[0109] Step 1: The user initiates a request to create an AI Station target detection service through the AI Station front end and confirms success;
[0110] Step 2: The user initiates an AI Station detection task request through the AI Station front end and confirms success;
[0111] Step 3: The AI Station front end reads the images from the hard drive;
[0112] Step 4: The AI Station front-end initiates an image detection HTTP request (containing image data) to the AIStation object detection service;
[0113] Step 5: After receiving the request, the AI Station object detection service performs image detection and returns the results to the AIStation front end.
[0114] Step 6: Users can use the AI Station front end to query the services they created, the progress of tasks, and the usage of resources (CPU, memory, GPU, etc.).
[0115] Step 7: After the task is completed, the user can view the detection result file on the AI Station front end to carry out subsequent work.
[0116] Specifically, for each module of the AI Station target computing platform: the AI Station front-end is written in C++ and will eventually be compiled into a dynamic library. Users need to include this dynamic library in their programs and then call its API for service management, task management, querying, and other operations. The AI Station controller is written in GoLang for concurrency considerations.
[0117] Next, this application will describe the process of the target computing platform implementing target detection services and detection tasks through the following embodiments:
[0118] Example 1
[0119] In this embodiment, the process of creating a service is described:
[0120] Step 1: When the AI Station frontend sends an HTTP request to the AI Station controller to create a service, it includes the following information:
[0121] The service namespace (equivalent to the namespace of the object detection service mentioned above): corresponds to the Kubernetes namespace, used to distinguish different users or different service collections;
[0122] Service name (equivalent to the name of the target detection service mentioned above): The service name is unique within the same namespace;
[0123] The service image (equivalent to the image information of the target detection service mentioned above): that is, the Docker image running in the service's copy (Pod);
[0124] Minimum number of service replicas: Since the number of service replicas can be dynamically scaled up or down based on QPS, it is necessary to set a minimum number of service replicas, which is the minimum number of replicas that can be achieved when scaling down.
[0125] Maximum number of service replicas: The maximum number of replicas that the service can achieve when scaling up;
[0126] Minimum CPU: The minimum amount of CPU used to serve each replica;
[0127] Maximum CPU: The maximum amount of CPU used to serve each replica;
[0128] Minimum memory usage: The minimum amount of memory used to serve each replica;
[0129] Maximum memory: The maximum amount of memory used to serve each replica.
[0130] Among these, the minimum and maximum CPU values mentioned above correspond to central processing unit information, and the minimum and maximum memory values mentioned above correspond to memory information. The minimum and maximum number of service replicas correspond to the replica information of the object detection service.
[0131] Step 2: The HTTP response returned by the AI Station controller, and the response information includes the following:
[0132] Code (equivalent to the service code of the target detection service mentioned above): If the service is created successfully, the value is 0; otherwise, it is non-zero.
[0133] Message (equivalent to the indication information of the target detection service mentioned above): If the service is created successfully, the value is an empty string; otherwise, it contains an error message.
[0134] Service ID (equivalent to the service number of the target detection service mentioned above): A unique identifier for the service;
[0135] The URL of the service (equivalent to the Uniform Resource Locator of the object detection service mentioned above): This URL is used when a user creates a task to send an image to it;
[0136] Service status (equivalent to the running status of the target detection service mentioned above): indicates the current status of the service, such as "running", "creation failed", etc.
[0137] Service creation time (equivalent to the creation time of the target detection service mentioned above): Service creation time;
[0138] Service update time (equivalent to the update time of the target detection service mentioned above): Service update time.
[0139] Example 2
[0140] In this embodiment, the process of updating the service is described:
[0141] Step 1: The AI Station frontend sends an HTTP request to the AI Station controller to update the minimum and maximum replica counts, including the following information:
[0142] Service ID: A unique identifier for the service;
[0143] Service namespaces: Corresponding to Kubernetes namespaces, used to distinguish different users or different collections of services;
[0144] Service name: Within the same namespace, the service name is unique;
[0145] Minimum number of service replicas: Since the number of service replicas can be dynamically scaled up or down based on QPS, it is necessary to set a minimum number of service replicas, which is the minimum number of replicas that can be achieved when scaling down.
[0146] Maximum number of service replicas: The maximum number of replicas that the service can achieve when scaling up.
[0147] Step 2: The AI Station controller sends a response to the HTTP request for the update service, containing the following information:
[0148] Code: If the service update is successful, the value is 0; otherwise, it is non-zero.
[0149] Message: If the service update is successful, the value is an empty string; otherwise, it contains an error message.
[0150] Service ID: A unique identifier for the service;
[0151] The service URL: This URL is used to send images when a user creates a task;
[0152] Service status: Indicates the current status of the service, such as "running", "creation failed", etc.
[0153] Service creation time: The time when the service was created;
[0154] Service update time: Service update time.
[0155] Example 3
[0156] In this embodiment, the process of deleting a service is described:
[0157] Step 1: The AI Station frontend sends an HTTP request to the AI Station controller to delete the service, containing the following information:
[0158] Service ID: A unique identifier for the service;
[0159] Service namespaces: Corresponding to Kubernetes namespaces, used to distinguish different users or different collections of services;
[0160] Service name: Within the same namespace, the service name is unique.
[0161] Step 2: The AI Station controller sends a response to the HTTP request for the service deletion, including the following information:
[0162] Code: If the service was successfully deleted, the value is 0; otherwise, it is non-zero.
[0163] Message: If the service was successfully deleted, the value is an empty string; otherwise, it contains an error message.
[0164] Example 4
[0165] In this embodiment, the process of creating a task is described:
[0166] Step 1: The AI Station front-end sends an HTTP request to the AI Station controller to create a detection task, containing the following information:
[0167] Service ID: A unique identifier for the service;
[0168] Service namespaces: Corresponding to Kubernetes namespaces, used to distinguish different users or different collections of services;
[0169] Service name: Within the same namespace, the service name is unique;
[0170] The folder containing the images: contains the images that will be sent;
[0171] Concurrency: How many threads are used to send images;
[0172] Customer Information: Includes information that customers can customize.
[0173] Step 2: The AI Station backend controller sends a response to the HTTP request for creating the detection task, including the following information:
[0174] Code (equivalent to the task code of the first detection task mentioned above): If the task is created successfully, the value is 0; otherwise, it is non-zero.
[0175] Message (equivalent to the indication information of the first detection task mentioned above): If the task is created successfully, the value is an empty string; otherwise, it contains an error message.
[0176] Task ID (equivalent to the task number of the first detection task mentioned above): The unique identifier of the task;
[0177] Task creation time (equivalent to the creation time of the first detection task mentioned above): Task creation time;
[0178] Task update time (equivalent to the update time of the first detection task mentioned above): Task update time.
[0179] Example 5
[0180] In this embodiment, the process of querying the service is described:
[0181] Step 1: The AI Station front-end sends an HTTP request to the AI Station controller to query the service, containing the following information:
[0182] Service ID: A unique identifier for the service; this parameter is optional.
[0183] Service namespace: Corresponds to the Kubernetes namespace, used to distinguish different users or different service collections. This parameter is optional.
[0184] Service name: Within the same namespace, the service name is unique. This parameter is optional.
[0185] Maximum number of services returned: If no single service is specified in the above 3 parameters, multiple services will be returned. Therefore, users may want to limit the number of services returned. This parameter is optional.
[0186] Step 2: The AI Station controller sends a response to the HTTP request for the query service, containing the following information:
[0187] Code: If the service query is successful, the value is 0; otherwise, it is non-zero.
[0188] Message: If the service query is successful, the value is an empty string; otherwise, it contains an error message.
[0189] Service ID: A unique identifier for the service;
[0190] Service namespaces: Corresponding to Kubernetes namespaces, used to distinguish different users or different collections of services;
[0191] Service name: Within the same namespace, the service name is unique;
[0192] Service image: that is, the Docker image running in a copy (Pod) of the service;
[0193] Minimum number of service replicas: Since the number of service replicas can be dynamically scaled up or down based on QPS, it is necessary to set a minimum number of service replicas, which is the minimum number of replicas that can be achieved when scaling down.
[0194] Maximum number of service replicas: The maximum number of replicas that the service can achieve when scaling up;
[0195] Minimum CPU: The minimum amount of CPU used to serve each replica;
[0196] Maximum CPU: The maximum amount of CPU used to serve each replica;
[0197] Minimum memory usage: The minimum amount of memory used to serve each replica;
[0198] Maximum memory: The maximum amount of memory used to serve each replica;
[0199] The service URL: This URL is used to send images when a user creates a task;
[0200] Service status: Indicates the current status of the service, such as "running", "creation failed", etc.
[0201] Service creation time: The time when the service was created;
[0202] Service update time: Service update time.
[0203] Example 6
[0204] In this embodiment, the process of the query task is described as follows:
[0205] Step 1: The AI Station frontend sends an HTTP request for a query task to the AI Station controller, containing the following information:
[0206] Task ID: A unique identifier for the task; this parameter is optional.
[0207] Maximum number of tasks returned: If no task ID is specified, multiple tasks will be returned, so users may want to limit the number of tasks returned. This parameter is optional.
[0208] Step 2: The AI Station controller sends a response to the HTTP request for the query task, including the following information:
[0209] Code: If the task query is successful, the value is 0; otherwise, it is non-zero.
[0210] Message: If the task query is successful, the value is an empty string; otherwise, it contains an error message.
[0211] Task ID: A unique identifier for a task;
[0212] Task creation time: The time when the task was created;
[0213] Task update time: The update time of the task;
[0214] Service ID: A unique identifier for the service;
[0215] Service namespaces: Corresponding to Kubernetes namespaces, used to distinguish different users or different collections of services;
[0216] Service name: Within the same namespace, the service name is unique;
[0217] The service URL: This URL is used to send images when a user creates a task;
[0218] The folder containing the images: contains the images that will be sent;
[0219] Concurrency: How many threads are used to send images;
[0220] Customer Information: Includes information that customers can customize.
[0221] Example 6
[0222] In this embodiment, the process of querying resources is described:
[0223] Step 1: The AI Station front end sends an HTTP request to the AI Station controller to query resources, but does not include the data portion.
[0224] Step 2: The AI Station controller sends a response to the HTTP request for the queried resource, including the following information:
[0225] Code: If the resource query is successful, the value is 0; otherwise, it is non-zero.
[0226] Message: If the resource query is successful, the value is an empty string; otherwise, it contains an error message.
[0227] Total: Total cluster resources, including the following three sub-items:
[0228] Cpu: number of CPUs;
[0229] Memory: Memory size;
[0230] Gpu: Number of GPUs.
[0231] Allocated: The amount of resources used by all running services, including the following three sub-items:
[0232] Cpu: number of CPUs;
[0233] Memory: Memory size;
[0234] Gpu: Number of GPUs.
[0235] Free: The amount of remaining available resources, including the following three sub-items:
[0236] Cpu: number of CPUs;
[0237] Memory: Memory size;
[0238] Gpu: Number of GPUs.
[0239] Through the above embodiments, it can be determined that the AI Station target computing platform allows users to create corresponding railway inspection target detection services simply by calling the service creation interface and filling in a few parameters. The AI Station target computing platform will create a unique ID and URL for each service and return them to the user. Then, the user can call the detection task creation interface and fill in a few parameters to perform image detection. Since the service URL is already known, the user-created task knows which URL to send the image to. Furthermore, the AI Station target computing platform supports automatic scaling based on QPS (based on KNative software), load balancing (based on Istio software), and automatic recovery in case of failure (based on Kubernetes high availability mechanism).
[0240] The above-mentioned solution addresses the challenges of model management and version iteration for edge nodes in railway inspection scenarios, which require extensive operation and maintenance personnel with deep learning inference experience. It proposes a Kubernetes-based target computing platform solution with automated service deployment and management capabilities. Furthermore, because the target computing platform supports multiple service replicas, it can start new replicas when a single service replica fails, providing fault recovery capabilities. Addressing the issues of excessively long processing times in existing detection services (e.g., Max(time image analysis / time image acquisition) ≈ 8, Min(time image analysis / time image acquisition) ≈ 2) and low scalability with multiple GPUs, the solution dynamically adjusts the number of service replicas based on the number of detection tasks. This scalability supports high-concurrency task requests. Moreover, since railway inspection uses various image detection algorithms, such as surface defect detection and fastener location recognition, existing solutions require independent configuration of computing resource permissions for different algorithms, hindering unified management and scheduling. The target computing platform provided in this application enables the management of large-scale image processing server clusters.
[0241] Optionally, this application also provides other solutions for performing detection tasks, namely, providing task detection based on existing computing platforms, such as Tencent Edge Computing Platform (IECP), Huawei Intelligent Edge Fabric, and Alibaba Link IoT Edge.
[0242] Among them, the Tencent Edge Computing Platform (IECP) uses the SuperEdge open-source method to build the platform. The edge unitization method only supports deployment capability. Since the underlying technology (SuperEdge) used by the platform does not make corresponding cuts to Kubernetes, the platform has a high consumption of computing and storage resources. It is difficult for small edge computing devices (or small edge servers) to install the Tencent Edge Computing Platform.
[0243] For Huawei's Intelligent Edge Fabric: The underlying technology uses the self-developed KubeEdge. Although KubeEdge has made some lightweight cuts to Kubernetes, it has made intrusive modifications to Kubernetes due to changes in the Kubernetes source code and the addition of some library files. This makes it incompatible with various open source versions and reduces the convenience of subsequent upgrades and maintenance of Kubernetes.
[0244] For Alibaba's intelligent computing platform (Link IoT Edge): The platform capabilities are built using OpenYurt technology, which can adapt well to various cloud-native ecosystems and can basically support the two important features of edge autonomy and edgeization. However, since not much work has been done on the underlying Kubernetes trimming, the entire software platform cannot achieve lightweight deployment, and it does not provide support for edge devices (sensors, cameras, etc.) for video monitoring scenarios. It can be regarded as a relatively basic platform software.
[0245] In one embodiment, the performance of the three platforms described above is compared, and the comparison results are shown in Table 1:
[0246] Table 1 Performance Comparison Results of Existing Computing Platforms
[0247]
[0248]
[0249] In addition, this application also provides a solution for users to implement detection tasks without relying on the target computing platform or other existing computing platforms. The specific solution includes:
[0250] Step 1: First, determine which server the Docker container for image detection needs to run on. This requires the user to check the remaining CPU, memory, and GPU resources of all servers, and then determine the server and GPU that meet the requirements.
[0251] Step 2: Next, determine the name of the Docker container for image detection that needs to be started (the names of containers started on the same server cannot be repeated, so the user needs to record all the containers that have been started before);
[0252] Step 3: Determine again the port exposed by the Docker container for image detection that needs to be started to receive images for detection. Similarly, the ports exposed by containers started on the same server cannot be duplicated.
[0253] Step 4: Start the Docker container for image detection based on the number of CPUs, memory, GPUs, images, and ports;
[0254] Step 5: When a user sends a detection request, a suitable container needs to be found from all the started image detection containers. However, it is not easy for the user to know which containers are currently idle, so they may have to select one randomly, which can easily cause congestion or even detection failure.
[0255] Step 6: When a detection container is no longer in use, the user needs to determine which server the container is on before manually stopping it.
[0256] Compared to the methods mentioned above, which suffer from congestion and even detection failures due to the inability to perform load balancing when users send detection requests, the AI Station target computing platform solution achieves load balancing by using Istio as its traffic management software. This maximizes the efficiency of the target detection service. Users can create services with different AI algorithms through the service creation interface by specifying different Docker images when calling the service creation interface (different Docker images run different AI algorithms). The AI Station target computing platform will automatically select available servers and GPUs based on the user's resource requirements (CPU, memory, GPU) and the images.
[0257] Furthermore, in one embodiment, combined with Figure 5This section describes the AI Station image object detection service. The AI Station image object detection service itself is a KNative service created using KFServing. It supports automatic fault recovery; if a replica of the service crashes due to an anomaly, a new Pod will start to take its place. It also supports elastic scaling based on QPS. Since the number of image detection tasks created by users varies at different times—for example, more during the day or more at night—it requires fewer service replicas when the number of tasks is low to save resources, and more service replicas when the number of tasks is high to meet the task processing demands. Figure 5 As shown, the AI Station image object detection service can have multiple copies, each of which may be scheduled to a different GPU.
[0258] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0259] This embodiment also provides a device for determining detection results, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0260] Figure 6 This is a structural block diagram of the device for determining the detection results according to an embodiment of this application, such as... Figure 6 As shown, the device includes:
[0261] The first creation module 62 is used to respond to a service creation request sent by the front-end service of the target computing platform and create a target detection service through the back-end controller of the target computing platform, wherein the target detection service is used to execute the created detection task;
[0262] The second creation module 64 is used to, in response to the first task creation request sent by the front-end service, create a first detection task associated with the target detection service through the back-end controller when the target detection service is successfully created, wherein the first detection task is used to detect objects of a first type;
[0263] Execution module 66 is used to acquire a first image sent by the front-end service, perform a first detection task on the first image through the target detection service, and obtain a first detection result, wherein the first detection result is used to indicate whether the first type of object is detected in the first image;
[0264] The sending module 68 is used to send the first detection result to the front-end service.
[0265] Using the above-described apparatus, in response to a service creation request sent by the front-end service of the target computing platform, a target detection service is created by the back-end controller of the target computing platform. This target detection service executes the created detection task. If the target detection service is successfully created, in response to a first task creation request sent by the front-end service, a first detection task associated with the target detection service for detecting a first type of object is created by the back-end controller. A first image sent by the front-end service is acquired, and the first detection task is executed on the first image by the target detection service to obtain a first detection result. The first detection result is then sent to the front-end service. This approach addresses the problem of improving the efficiency of determining detection results, thereby achieving the effect of improving the efficiency of determining detection results.
[0266] In an exemplary embodiment, the apparatus for determining the detection result further includes: a first response module, configured to, upon successful creation of the target detection service, respond to a second task creation request sent by the front-end service, create a second detection task associated with the target detection service through the back-end controller, wherein the second detection task is used to detect a second type of object; acquire a second image sent by the front-end service, perform the second detection task on the second image through the target detection service to obtain a second detection result, wherein the second detection result is used to indicate whether a second type of object is detected in the second image; and send the second detection result to the front-end service.
[0267] It should be noted that the second type of object is different from the first type of object. For example, the first type of object can represent a dynamic object, while the second type of object is a static object. This application only distinguishes different detection tasks by limiting the first type and the second type, without making specific limitations on the first type and the second type.
[0268] In an exemplary embodiment, the execution module is further configured to: perform the first detection task on the first image through a first service replica that is in an idle state among the plurality of service replicas to obtain the first detection result; and perform the second detection task on the second image through the target detection service to obtain the second detection result, including: performing the second detection task on the second image through a second service replica that is in an idle state among the plurality of service replicas to obtain the second detection result.
[0269] Optionally, for the multiple service replicas in the above embodiments, all have the same execution level for the second image. When there are multiple idle second service replicas among the multiple service replicas, one can be selected to execute the second detection task.
[0270] In an exemplary embodiment, the apparatus for determining the detection result further includes: a second response module, configured to, upon successful creation of the target detection service, respond to a second task creation request sent by the front-end service, create a second detection task associated with the target detection service via the back-end controller, wherein the second detection task is used to detect a second type of object; upon obtaining the first image sent by the front-end service, perform the second detection task on the first image via the target detection service to obtain a third detection result, wherein the third detection result is used to indicate whether a second type of object is detected in the first image; and send the third detection result to the front-end service.
[0271] In an exemplary embodiment, the apparatus for determining the detection result further includes: a third creation module, configured to create a service replica scaling service corresponding to the target detection service after creating the target detection service, wherein the service replica scaling service is used to adjust the number of service replicas of the target detection service, and the service replicas of the target detection service are used to execute the created detection task; when it is detected that the number of service replicas of the target detection service needs to be adjusted, the first group of service replicas currently possessed by the target detection service is adjusted to a second group of service replicas through the service replica scaling service, wherein the number of service replicas in the first group of service replicas and the second group of service replicas is different; the service replicas in the second group of service replicas are respectively scheduled to the target image server in a group of image processors corresponding to the backend controller, wherein the service replicas in the second group of service replicas are used to call the target image server to execute the image processing operation in the corresponding detection task when executing the corresponding detection task.
[0272] In an exemplary embodiment, the apparatus for determining the detection result further includes: an adjustment module, configured to obtain the number of detection tasks associated with the target detection service created within a predetermined time period; and determine whether the number of service copies of the target detection service needs to be adjusted based on the obtained number of detection tasks.
[0273] In an exemplary embodiment, the adjustment module is further configured to, when the number of detected tasks obtained is greater than a preset number threshold, adjust the first group of service replicas currently possessed by the target detection service to the second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is less than the number of service replicas in the second group of service replicas; and when the number of detected tasks obtained is less than or equal to the preset number threshold, adjust the first group of service replicas currently possessed by the target detection service to the second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is greater than the number of service replicas in the second group of service replicas.
[0274] In an exemplary embodiment, the first creation module is further configured to: obtain first service information, central processing unit information, and memory information from the service creation request; and, if the first service information provides the namespace of the target detection service, the name of the target detection service, the mirror information of the target detection service, and the copy information of the target detection service, create the target detection service based on the namespace of the target detection service, the name of the target detection service, the mirror information of the target detection service, the copy information of the target detection service, the central processing unit information, and the memory information; wherein the central processing unit information represents the processing capacity of the target detection service, and the memory information represents the storage space occupied by the target detection service.
[0275] In an exemplary embodiment, the apparatus for determining the detection result further includes: a first determining module, configured to acquire first response information sent by the backend controller after creating the target detection service; and, if the first response information contains second service information, determine that the target detection service has been successfully created; wherein the second service information includes at least one of the following: the service code of the target detection service, the indication information of the target detection service, the service number of the target detection service, the Uniform Resource Locator (URL) of the target detection service, the running status of the target detection service, the creation time of the target detection service, and the update time of the target detection service; wherein the service code of the target detection service is used to indicate the creation status of the target detection service, whether the indication information of the target detection service is empty is used to indicate whether the target detection service has been successfully created, the service number of the target detection service is the unique identifier of the target detection service, and the URL of the target detection service is the receiving address when receiving the image sent by the frontend service.
[0276] In this embodiment, since corresponding service information can be generated during the creation of the target detection service, the success of the target detection service creation can be determined by the content of the service information contained in the response information.
[0277] In an exemplary embodiment, the device for determining the detection result further includes: a second determining module, configured to acquire second response information sent by the backend controller after creating the first detection task; and determine that the first detection task was successfully created if the second response information contains task information; wherein the task information includes at least one of the following: the task code of the first detection task, the indication information of the first detection task, the task number of the first detection task, the creation time of the first detection task, and the update time of the first detection task; wherein the task code of the first detection task is used to indicate the creation status of the first detection task, whether the indication information of the first detection task is empty is used to indicate whether the first detection task was successfully created, and the task number of the first detection task is a unique identifier of the first detection task.
[0278] In this embodiment, since corresponding task information can be generated during the creation of the detection task, the success of the detection task creation can be determined by the content of the task information contained in the response information. For example, if the task code of the first detection task in the above task information indicates that the detection task creation failed, then the detection task was not created successfully.
[0279] It should be noted that, in the above embodiments, the task code of the first detection task can be set to Arabic numerals. For example, if the task code of the first detection task is determined to be 0, it can be determined that the first detection task was created successfully; if the task code of the first detection task is determined to be non-zero, it can be determined that the first detection task was created unsuccessfully. The indication information of the first detection task can be set to a string. For example, if the indication information of the first detection task is determined to be an empty string, it can be determined that the first detection task was created successfully; if the string of the first detection task is determined to contain garbled characters, it can be determined that the first detection task was created unsuccessfully.
[0280] The explanation process for the service code and instruction information of the target detection service can refer to the above explanation of the task code and instruction information of the first detection task, and will not be repeated here.
[0281] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0282] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0283] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0284] Embodiments of this application also provide an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the method embodiments described above. The specific steps are as follows:
[0285] S1, in response to a service creation request sent by the front-end service of the target computing platform, a target detection service is created through the back-end controller of the target computing platform, wherein the target detection service is used to execute the created detection task;
[0286] S2, if the target detection service is successfully created, in response to the first task creation request sent by the front-end service, a first detection task associated with the target detection service is created through the back-end controller, wherein the first detection task is used to detect objects of a first type;
[0287] S3, acquire the first image sent by the front-end service, perform a first detection task on the first image through the target detection service, and obtain a first detection result, wherein the first detection result is used to indicate whether the first type of object is detected in the first image;
[0288] S4, send the first detection result to the front-end service.
[0289] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0290] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0291] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0292] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for determining a test result, characterized in that, include: In response to a service creation request sent by the front-end service of the target computing platform, a target detection service is created through the back-end controller of the target computing platform. The target detection service is used to execute the created detection task and is a service deployed in the back-end controller. If the target detection service is successfully created, the Uniform Resource Locator of the target detection service is fed back to the front-end service, and in response to the first task creation request sent by the front-end service, a first detection task associated with the target detection service is created through the back-end controller, wherein the first detection task is used to detect objects of a first type; The first image sent by the front-end service to the target detection service via a Uniform Resource Locator is obtained, and a first detection task is performed on the first image by the target detection service to obtain a first detection result, wherein the first detection result is used to indicate whether the first type of object is detected in the first image; Send the first detection result to the front-end service.
2. The method according to claim 1, characterized in that, The method further includes: If the target detection service is successfully created, in response to the second task creation request sent by the front-end service, a second detection task associated with the target detection service is created through the back-end controller, wherein the second detection task is used to detect objects of a second type; The second image sent by the front-end service is obtained, and a second detection task is performed on the second image through the target detection service to obtain a second detection result, wherein the second detection result is used to indicate whether the second type of object is detected in the second image; The second detection result is sent to the front-end service.
3. The method according to claim 2, characterized in that, In the case that the target detection service has multiple service copies, The step of performing a first detection task on the first image through the target detection service to obtain a first detection result includes: performing the first detection task on the first image through a first service replica that is in an idle state among the plurality of service replicas to obtain the first detection result; The step of performing a second detection task on the second image through the target detection service to obtain a second detection result includes: performing the second detection task on the second image through a second service replica that is in an idle state among the plurality of service replicas to obtain the second detection result.
4. The method according to claim 1, characterized in that, The method further includes: If the target detection service is successfully created, in response to the second task creation request sent by the front-end service, a second detection task associated with the target detection service is created through the back-end controller, wherein the second detection task is used to detect objects of a second type; Upon receiving the first image sent by the front-end service, the target detection service performs a second detection task on the first image to obtain a third detection result, wherein the third detection result is used to indicate whether the second type of object is detected in the first image; The third detection result is sent to the front-end service.
5. The method according to claim 1, characterized in that, The method further includes: After creating the target detection service, a service replica scaling service is created corresponding to the target detection service. The service replica scaling service is used to adjust the number of service replicas of the target detection service, and the service replicas of the target detection service are used to execute the created detection tasks. If it is detected that the number of service replicas of the target detection service needs to be adjusted, the first group of service replicas currently existing in the target detection service is adjusted to the second group of service replicas through the service replica scaling service, wherein the number of service replicas in the first group of service replicas and the second group of service replicas are different; The service replicas in the second group of service replicas are respectively scheduled to the target image server in the group of image processors corresponding to the backend controller. The service replicas in the second group of service replicas are used to call the target image server to perform the image processing operation in the corresponding detection task when executing the corresponding detection task.
6. The method according to claim 5, characterized in that, Before adjusting the first group of service replicas currently possessed by the target detection service to the second group of service replicas through the service replica scaling service when it is detected that the number of service replicas of the target detection service needs to be adjusted, the method further includes: Get the number of detection tasks associated with the target detection service created within the predetermined time period; Based on the number of detection tasks obtained, determine whether it is necessary to adjust the number of service copies of the target detection service.
7. The method according to claim 6, characterized in that, The step of adjusting the first set of service replicas currently possessed by the target detection service to the second set of service replicas through the service replica scaling service includes: If the number of detection tasks obtained is greater than a preset threshold, the first group of service replicas currently possessed by the target detection service is adjusted to the second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is less than the number of service replicas in the second group of service replicas. If the number of detection tasks obtained is less than or equal to the preset number threshold, the first group of service replicas currently possessed by the target detection service is adjusted to the second group of service replicas through the service replicas, wherein the number of service replicas in the first group of service replicas is greater than the number of service replicas in the second group of service replicas.
8. The method according to claim 1, characterized in that, The step of creating a target detection service in response to a service creation request sent by the front-end service of the target computing platform, through the back-end controller of the target computing platform, includes: The first service information, central processing unit information, and memory information are obtained from the service creation request. Given the namespace, name, mirror information, and copy information of the target detection service provided by the first service information, the target detection service is created based on the namespace, name, mirror information, copy information, CPU information, and memory information of the target detection service; wherein the CPU information represents the processing capacity of the target detection service, and the memory information represents the storage space occupied by the target detection service.
9. The method according to claim 1, characterized in that, The method further includes: Obtain the first response information sent by the backend controller after creating the target detection service; If the first response information contains the second service information, it is determined that the target detection service has been successfully created; The second service information includes at least one of the following: the service code of the target detection service, the indication information of the target detection service, the service number of the target detection service, the Uniform Resource Locator of the target detection service, the running status of the target detection service, the creation time of the target detection service, and the update time of the target detection service; The service code of the target detection service is used to indicate the creation status of the target detection service; whether the indication information of the target detection service is empty is used to indicate whether the target detection service has been created successfully; the service number of the target detection service is the unique identifier of the target detection service; and the Uniform Resource Locator of the target detection service is the receiving address when receiving the image sent by the front-end service.
10. The method according to claim 1, characterized in that, The method further includes: Obtain the second response information sent by the backend controller after creating the first detection task; If the second response information contains task information, it is determined that the first detection task was successfully created; The task information includes at least one of the following: the task code of the first detection task, the indication information of the first detection task, the task number of the first detection task, the creation time of the first detection task, and the update time of the first detection task. Wherein, the task code of the first detection task is used to indicate the creation status of the first detection task, whether the indication information of the first detection task is empty is used to indicate whether the first detection task has been created successfully, and the task number of the first detection task is the unique identifier of the first detection task.
11. A device for determining a test result, characterized in that, include: The first creation module is used to respond to a service creation request sent by the front-end service of the target computing platform and create a target detection service through the back-end controller of the target computing platform. The target detection service is used to execute the created detection task and is a service deployed in the back-end controller cluster. The second creation module is used to, when the target detection service is successfully created, feed back the Uniform Resource Locator of the target detection service to the front-end service, and in response to the first task creation request sent by the front-end service, create a first detection task associated with the target detection service through the back-end controller, wherein the first detection task is used to detect objects of a first type; An execution module is used to acquire a first image sent by the front-end service to the target detection service via a Uniform Resource Locator, and to perform a first detection task on the first image through the target detection service to obtain a first detection result, wherein the first detection result is used to indicate whether an object of the first type is detected in the first image; The sending module is used to send the first detection result to the front-end service.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 10.
13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 10.
Citation Information
Patent Citations
Server-free system and method, computer equipment and storage medium
CN114979104A
Checkpointing for GPU-as-a-service in cloud computing environment
US10275851B1