Mirror image manufacturing method, device, equipment and medium

By using two task executors and status monitoring mechanisms with different functions in the image production process, it solves the problems of long image production, difficulty in getting started, non-standard processes and complex management, and achieves more efficient image production and delivery.

CN119336346APending Publication Date: 2025-01-21HANGZHOU DBAPPSECURITY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411534421.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

During the mirror production process, it takes a long time, is difficult to get started, is not standardized, and has high management complexity, resulting in low mirror production speed and delivery efficiency.

Method used

By using two different functional task actuators, and based on the state of mirror production tasks, the corresponding operation, including obtaining the initial mirror uploaded by the user, creating mirror production tasks, put in the preset queue and task thread pool, monitor the task status status status And perform preset response operations, obtain and test mirrors, and finally archive the image.

Benefits of technology

It improves the speed of mirror production and the efficiency of project delivery, and improves the user's sense of experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336346A_ABST
    Figure CN119336346A_ABST
Patent Text Reader

Abstract

The invention discloses a mirror image manufacturing method and device, equipment and a medium, and relates to the technical field of mirror image generation, and the method comprises the steps: obtaining an initial mirror image, and creating a mirror image manufacturing task corresponding to the initial mirror image based on a user demand and a preset manufacturing process; putting the mirror image making task into a preset waiting queue, so that a first preset task executor puts the mirror image making task extracted from the preset waiting queue into a preset task thread pool, and a second preset task executor obtains the mirror image making task from the preset task thread pool and executes the mirror image making task; monitoring an execution state of the mirror image making task, and if the execution state is an abnormal state, executing a preset response operation on the mirror image making task to obtain a to-be-executed target task; and obtaining a to-be-tested mirror image after the second preset task executor executes the to-be-executed target task, testing the to-be-tested mirror image, and archiving the tested target mirror image. Therefore, the mirror image manufacturing speed and the delivery efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image generation, and in particular to an image production method, device, equipment and medium. Background Art

[0002] In the delivery scenario where images are delivered, the production and interaction of system images are key steps. However, due to the large differences and high complexity between projects and the diversity of image production scenarios, the following problems are faced in the process of image interaction:

[0003] Time-consuming: The long image production cycle affects the delivery schedule of the entire project, causing the overall project progress to be delayed; Difficult to get started: The production and interaction of images rely on experienced skilled workers, and the cost of getting started is high; The image production process is not standardized: The image production and interaction processes of various application environments lack standardization, resulting in uneven quality of images interacting in different projects; High management complexity: The production of images relies on multiple modules, and an effective management mechanism is required to reduce the probability of errors during the image interaction process.

[0004] As can be seen from the above, how to improve the image production speed and delivery efficiency in the image production process is an urgent problem to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide an image production method, device, equipment and medium, which can use two task executors with different functions and perform corresponding operations based on the status of the image production task to improve the image production speed, thereby improving the project delivery efficiency and enhancing the user experience. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a mirror image production method, comprising:

[0007] Obtaining the initial image uploaded by the user, and creating an image production task corresponding to the initial image based on user requirements and a preset production process;

[0008] Put the image making task into a preset waiting queue, so that the first preset task executor puts the image making task extracted from the preset waiting queue into a preset task thread pool, so that the second preset task executor obtains the image making task from the preset task thread pool and executes it;

[0009] The execution state of the image production task is monitored, and if the execution state of the image production task is an abnormal state, a preset response operation is performed on the image production task to obtain a target task to be executed;

[0010] The image to be tested obtained after the second preset task executor executes the target task to be executed is obtained, so as to test the image to be tested, and archive the target image that passes the test.

[0011] Optionally, after placing the image production task into a preset waiting queue so that the first preset task executor puts the image production task extracted from the preset waiting queue into a preset task thread pool so that the second preset task executor obtains the image production task from the preset task thread pool and executes it, it also includes:

[0012] Implementing the image production task after execution through a preset task factory so that the user can manually trigger the implemented image production task;

[0013] The manually triggered image making task is put back into the preset waiting queue, so that the first preset task executor extracts the image making task from the preset waiting queue and puts the image making task into the preset task thread pool.

[0014] Optionally, after placing the image making task into a preset waiting queue, the method further includes:

[0015] Changing the state corresponding to the image making task to a first task state;

[0016] Correspondingly, after the first preset task executor puts the image making task extracted from the preset waiting queue into the preset task thread pool, it also includes:

[0017] Updating the state corresponding to the image making task from the first task state to the second task state;

[0018] Correspondingly, the image making task after execution is realized based on the preset factory so that the user can manually trigger the realized image making task, further comprising:

[0019] The state corresponding to the image making task is updated from the second task state to the third task state.

[0020] Optionally, monitoring the execution status of the image production task, and if the execution status of the image production task is an abnormal state, performing a preset response operation on the image production task, includes:

[0021] The execution status of the image production task is monitored. When an abnormal situation occurs in the image production task, the status corresponding to the image production task is updated from the third task status to the abnormal task status, and the second preset task executor is triggered to perform a task retry operation and a task rollback operation on the image production task, so that the first preset task executor puts the image production task back into the preset waiting queue after the task retry operation and the task rollback operation are completed.

[0022] Optionally, before performing a task retry operation and a task rollback operation on the image creation task, the process further includes:

[0023] Based on the sequential dependency relationship between the image production tasks, the image production tasks are numbered in ascending order, so that the second preset task executor executes the image production tasks in sequence according to the numbering order.

[0024] Optionally, after placing the image production task into a preset waiting queue so that the first preset task executor puts the image production task extracted from the preset waiting queue into a preset task thread pool so that the second preset task executor obtains the image production task from the preset task thread pool and executes it, it also includes:

[0025] The image making task is interrupted, and a preset third-party service is used to asynchronously check the execution status of the current image making task and the execution status of the subtasks corresponding to the image making task.

[0026] Optionally, after archiving the target image that has passed the test, the method further includes:

[0027] Using a preset state machine technology and based on the dimensional states corresponding to the three dimensions, corresponding operations are performed on the archived target images, so as to manage the target images;

[0028] Among them, different dimensions correspond to different dimensional states, and different dimensional states correspond to different operations; the three dimensions are respectively an image dimension, a test task dimension, and a release version dimension.

[0029] In a second aspect, the present application provides a mirror image production device, comprising:

[0030] A task creation module is used to obtain the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user requirements and a preset production process;

[0031] A task placing module, used for placing the image making task into a preset waiting queue, so that the first preset task executor can place the image making task extracted from the preset waiting queue into a preset task thread pool, so that the second preset task executor can obtain the image making task from the preset task thread pool and execute it;

[0032] A task monitoring module is used to monitor the execution status of the image production task, and if the execution status of the image production task is an abnormal state, perform a preset response operation on the image production task to obtain a target task to be executed;

[0033] The image archiving module is used to obtain the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested and archive the target image that passes the test.

[0034] In a third aspect, the present application provides an electronic device, including:

[0035] Memory, used to store computer programs;

[0036] The processor is used to execute the computer program to implement the aforementioned image making method.

[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned image production method when executed by a processor.

[0038] As can be seen from the above, before the image production is performed, the present application needs to obtain the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user needs and the preset production process; put the image production task into the preset waiting queue, so that the first preset task executor puts the image production task extracted from the preset waiting queue into the preset task thread pool, so that the second preset task executor obtains the image production task from the preset task thread pool and executes it; monitors the execution status of the image production task, and if the execution status of the image production task is an abnormal state, performs a preset response operation on the image production task to obtain the target task to be executed; obtains the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested, and archives the target image that passes the test. It can be seen that the present application puts the image making task into the preset waiting queue so that the first preset task executor extracts the image making task from the preset waiting queue and puts the image making task into the preset task thread pool, so that the second preset task executor can obtain the image making task from the preset task thread pool and perform the execution operation. At the same time, the execution status of the image making task is monitored. If the execution status of the image making task is abnormal, the preset response operation is performed on the image making task to obtain the target task to be executed, and the image to be tested obtained after the second preset task executor executes the target task to be executed. Finally, the image to be tested is tested, and the target image that passes the test is archived. In this way, the speed of image making and the efficiency of project delivery are improved, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1 A flow chart of a mirror image making method disclosed in this application;

[0041] Figure 2 A flow chart showing the forward and backward dependency relationships between the functional modules disclosed in this application;

[0042] Figure 3 A business process diagram of a mirror production task disclosed in this application;

[0043] Figure 4A core business process diagram of mirror production disclosed in this application;

[0044] Figure 5 A schematic diagram of a state machine corresponding to an image production process disclosed in this application;

[0045] Figure 6 A schematic diagram of an image management process disclosed in this application;

[0046] Figure 7 A schematic diagram of the task execution timing corresponding to a mirror production task disclosed in this application;

[0047] Figure 8 This is a structural flow chart of a mirror image making device disclosed in this application;

[0048] Fig. 9 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] In the delivery scenario where images are delivered, the production and interaction of system images are key steps. However, due to the large differences and high complexity between projects, as well as the diversity of image production scenarios, many problems are faced in the process of image interaction. To this end, the present application provides an image production method that can utilize two task executors with different functions and perform corresponding operations based on the status of the image production task to increase the speed of image production, thereby improving the delivery efficiency of the project and enhancing the user experience.

[0051] See also Figure 1 As shown, an embodiment of the present invention discloses a mirror image production method, comprising:

[0052] Step S11: Acquire the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user requirements and a preset production process.

[0053] In this embodiment, the present invention includes an image center module, a task center module and a configuration center module, wherein the image center module includes an unverified module, a verified module, a test list module and a published module. It is worth mentioning that the unverified module is used to provide functions such as uploading, downloading, verifying and deleting images, and is used to manage and process unverified images, thereby ensuring the integrity and availability of the images; the verified module is used to verify the unverified images, and upload the verified images to the cloud disk, extract them to the test list module and publish them to the outside; the test list module is used to manage and track the test tasks of the images, and record the test results for reference in subsequent steps; the published module is used to realize the sharing function of the images, that is, the present invention supports sharing the published images with teams or personnel who have demand for the images. For the task center module, its functions are as follows: manage and schedule the image production tasks, and can automatically process common task processes; integrate and save various image production templates, so that users can obtain the required image templates from various image production templates according to personal needs, so as to quickly create image creation tasks. The system settings module is mainly used to manage resource packages and scripts, perform basic configuration of product information, and includes a data dictionary function to help operators configure the image production platform to adapt to different image production scenarios.

[0054] It is worth mentioning that the dependencies between the functional modules are as follows: Figure 2 As shown: In a specific implementation, first, the user (Actor) can upload the initial image through the unverified module in the image center. Subsequently, the initial image is sent to the verified module to verify the initial image, that is, the integrity and authenticity of the initial image are ensured through preset steps and preset technologies, and the name and / or label of the verified image is changed to adapt to different development and deployment environments. Then, the verified image can self-test itself, and store the image that passes the self-test in the preset test list, so as to obtain the image from the preset test list, and test the image using the test version created by the user through the test list module, and publish the target image that passes the test.

[0055] Step S12: put the image production task into a preset waiting queue so that the first preset task executor can put the image production task extracted from the preset waiting queue into a preset task thread pool so that the second preset task executor can obtain the image production task from the preset task thread pool and execute it.

[0056] In another specific implementation, first, the user can configure the basic image information, scripts, and basic configuration information in advance so as to construct the image production task through the task center module and use the above information to obtain the image product. Subsequently, the image product is sent to the verified module to verify the image product, and the name and / or label of the verified image is changed to adapt to different development and deployment environments. Then, the verified image product can self-test itself, and the image that passes the self-test is stored in the preset test list, so as to obtain the image from the preset test list, and use the test version created by the user through the test list module to test the image, and publish the target image that passes the test.

[0057] It is understandable that after the user uploads the initial image in the unverified module of the image center, he needs to enter the task center module to use the functions of the task center module and create a task based on the initial image. Figure 3 As shown: First, users need to configure the basic image information, scripts and basic configuration information in advance based on their own needs, and use snapshot technology to read the preset production process in order to create an image production task. It is worth mentioning that during the image production task, you can determine whether to proceed to the next step or roll back the task according to the execution status of the task.

[0058] Afterwards, it is necessary to determine whether the preset production process is executed successfully. If the execution fails, the preset production process is executed again; if the execution succeeds, the image product after execution is published. If the release fails, the image product is returned, and the snapshot technology is used again to read the preset production process. If the validity period of the image product expires, the host will retain the image product for two days. If the validity period of the image product is not renewed, the host will clean up the image product. Finally, after the image production task is completed, the image can be archived and synchronized to the image management module so that the image management module can manage the image.

[0059] In this embodiment, after the second preset task executor obtains the image production task from the preset task thread pool, the image production task enters the manual trigger node. It is worth mentioning that after the image production task enters the manual trigger node, the user needs to trigger the manual trigger node. After the triggering, the image production task is put back into the preset waiting queue so that the first preset task executor can extract the image production task from the preset waiting queue again. Specifically, after the image production task is put into the preset waiting queue so that the first preset task executor puts the image production task extracted from the preset waiting queue into the preset task thread pool so that the second preset task executor can obtain the image production task from the preset task thread pool and execute it, it can also include: implementing the executed image production task through the preset task factory so that the user can manually trigger the implemented image production task; putting the manually triggered image production task back into the preset waiting queue so that the first preset task executor can extract the image production task from the preset waiting queue and put the image production task into the preset task thread pool.

[0060] It is worth mentioning that the image production process includes 8 steps, among which the relationship between the 8 steps in the above image production process is as follows: Figure 4 As shown, Figure 4The core business process flow chart for image production. First, the image production environment is built and pulled up, wherein the process of building and pulling up the image production environment includes: uploading the initial image using the hyper-converged platform, then starting the computer host, thereby starting the computer host from a closed state to a usable state, and then activating the computer host and the image production environment to ensure that the computer host and the image production environment are in an available state. Then, the image is produced in the above-mentioned image production environment, such as installing software, upgrading the system, and modifying the configuration to obtain the image product. It is worth mentioning that after obtaining the image product, the image product can be placed in the computer host, and then the preset post-operation is performed, such as closing unnecessary operation and maintenance channels to ensure the security of the image product; then, the temporary files and logs generated during the image production process are cleaned up to keep the image production environment clean and efficient. It is worth mentioning that after obtaining the image product, an environment for verifying the image product needs to be set, which usually includes configuring the necessary hardware and software resources to ensure the accuracy and reliability of the verification process. Then the image product is activated and manually verified, wherein the activation verification may involve automatic testing of certain functions or features of the image to ensure that they can work as expected. After the automatic test, manual verification is required to check whether all aspects of the image product meet the requirements, such as running some specific applications or services and observing their performance and stability during operation. Finally, the verified image products are archived, such as storing the image files in a safe and reliable location for future use or distribution of the image products.

[0061] It is worth mentioning that the corresponding status of the image making task after performing different operations is also different. Specifically, after putting the image making task into the preset waiting queue, it can also include: changing the status corresponding to the image making task to the first task status; accordingly, after the first preset task executor puts the image making task extracted from the preset waiting queue into the preset task thread pool, it can also include: updating the status corresponding to the image making task from the first task status to the second task status; accordingly, after the image making task is implemented based on the preset factory so that the user can manually trigger the implemented image making task, it can also include: updating the status corresponding to the image making task from the second task status to the third task status.

[0062] In this embodiment, during the process of the second preset task executor executing the image production task, the image production task can be interrupted according to user needs, or when an abnormal situation or error occurs in the image production task, the image production task can be interrupted. Specifically, after the image production task is placed in the preset waiting queue, so that the first preset task executor puts the image production task extracted from the preset waiting queue into the preset task thread pool, so that the second preset task executor obtains the image production task from the preset task thread pool and executes it, it can also include: interrupting the image production task, and using the preset third-party service to asynchronously check the execution status of the current image production task and the execution status of the subtask corresponding to the image production task.

[0063] Step S13: monitoring the execution status of the image production task. If the execution status of the image production task is abnormal, performing a preset response operation on the image production task to obtain a target task to be executed.

[0064] In this embodiment, different operations need to be performed on the image production task based on its different states, and the image production task is executed by combining the state machine, executor, factory, responsibility chain and task waiting queue to obtain the target image. Among them, the state machine corresponding to the image production process is as follows Figure 5 As shown: Detailed process of image production business flow chart: When an image production task is created, the basic information corresponding to the image production task will be configured in advance, such as the base image of the image, the software package to be installed, and the configuration file. Subsequently, the image production task is added to a task waiting queue called CONSTRUCT_QUEUE (a construction queue), and the task status is marked as PENDING (pending).

[0065] It is worth mentioning that the first executor ImageMakeTaskExecutor (i.e., an executor) is used to monitor the task waiting queue. If there is an image making task in the task waiting queue and the system has idle resources, the first executor will take the task out of the task waiting queue and start the preset task thread pool ADD_SERVICE (i.e., a thread pool) to execute the task. At this time, the status of the image making task will be changed to RUNNING. It is worth mentioning that the extracted image making task can perform a series of operations through the second executor ActionChainBuilder (i.e., an executor), where the above operations may be implemented by different factories, which are used to create different types of images, and when the image making task reaches a node that requires manual operation, the status will change to TO_DO (pending operation) or TO_VERIFY (pending verification). After the manual operation node is completed, the image making task will enter the task waiting queue again to wait for the first executor to continue to perform subsequent operations.

[0066] It is worth mentioning that during the execution of the image production task, the system will continuously detect whether there are exceptions or errors during the execution of the task, wherein the exceptions or errors include build failure, software package installation failure, and configuration file errors. If the image production task encounters an exception during the execution, it will enter the FAIL (failure) state. At this time, the image production task can be retried or rolled back, wherein the retry operation will allow the image production task to re-enter the task waiting queue, and the rollback operation will undo the previous build steps and restore the task to the previous state in order to wait for the first executor to execute. Among them, when performing retry and rollback operations, not only the rollback of the business logic is involved, but also the order relationship between the operation nodes needs to be considered to ensure data consistency and the correctness of the business logic. In this embodiment, if the image production task is rolled back, the image production task will enter the ROLLING_BACK (rolling back) state. When the rollback operation is completed, the task state becomes ROLLBACK (rolled back). At this time, the image production task can be manually triggered to enter the waiting task queue again and wait for execution.

[0067] In this embodiment, during the execution of the task, a thread interrupt can be called to exit the image production task, and the status becomes CANCELLED (canceled), so that the user can re-select to create a task or perform other operations. Since the image production task involves multiple third-party services, and these third-party services have a long execution time, when the image production task is interrupted, in addition to interrupting the operation of this project, it is also necessary to ensure that other tasks associated with the project are also consistent with the status corresponding to this project through asynchronous verification, such as interrupt status or completion status. When the task is successfully executed, the status will be changed to SUCCESS (success), so that the generated target image is obtained, and the target image is stored in the preset image warehouse, so that subsequent users can view and manage the target image stored in the preset image warehouse by using API calls and graphical interfaces.

[0068] In this embodiment, when the second preset task executor executes the image production task, it is necessary to monitor the execution status of the image production task so that the corresponding operation can be performed on the image production task based on the execution status of the image production task in a timely manner. Specifically, the execution status of the image production task is monitored, and if the execution status of the image production task is an abnormal state, a preset response operation is performed on the image production task, which may include: monitoring the execution status of the image production task, when an abnormal situation occurs in the image production task, updating the state corresponding to the image production task from the third task state to the abnormal task state, and triggering the second preset task executor to perform a task retry operation and a task rollback operation on the image production task, so that the first preset task executor puts the image production task back into the preset waiting queue after the task retry operation and the task rollback operation are completed.

[0069] It is worth mentioning that in the process of executing a plurality of image production tasks, the image production tasks need to be executed based on the dependencies between the plurality of image production tasks. Specifically, before executing the task retry operation and the task rollback operation on the image production task, it may also include: based on the dependencies between the image production tasks, the image production tasks are numbered in ascending order, so that the second preset task executor executes the image production tasks in sequence according to the numbering order.

[0070] Step S14: obtaining the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested, and archiving the target image that passes the test.

[0071] In this embodiment, after obtaining the target image that passes the test, the target image needs to be managed. Specifically, after archiving the target image that passes the test, it can also include: using a preset state machine technology and performing corresponding operations on the archived target images based on the dimensional states corresponding to the three dimensions, so as to manage the target images; wherein different dimensions correspond to different dimensional states, and different dimensional states correspond to different operations; the three dimensions are image dimension, test task dimension, and release version dimension.

[0072] As can be seen from the above, before the image production is performed, the present application needs to obtain the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user needs and the preset production process; put the image production task into the preset waiting queue, so that the first preset task executor puts the image production task extracted from the preset waiting queue into the preset task thread pool, so that the second preset task executor obtains the image production task from the preset task thread pool and executes it; monitors the execution status of the image production task, and if the execution status of the image production task is an abnormal state, performs a preset response operation on the image production task to obtain the target task to be executed; obtains the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested, and archives the target image that passes the test. It can be seen that the present application puts the image making task into the preset waiting queue so that the first preset task executor extracts the image making task from the preset waiting queue and puts the image making task into the preset task thread pool, so that the second preset task executor can obtain the image making task from the preset task thread pool and perform the execution operation. At the same time, the execution status of the image making task is monitored. If the execution status of the image making task is abnormal, the preset response operation is performed on the image making task to obtain the target task to be executed, and the image to be tested obtained after the second preset task executor executes the target task to be executed, and finally the image to be tested is tested, and the target image that passes the test is archived. In this way, the speed of image production is improved, thereby improving the efficiency of project delivery and improving the user experience.

[0073] For further information, see Figure 6 As shown, an embodiment of the present invention discloses a mirror image production method, comprising:

[0074] In this embodiment, after generating a number of images based on user needs, the images need to be managed. The image management part mainly implements the entire management process through the state machine technology, that is, according to the control signal, the corresponding state transfer and corresponding operation are performed according to the pre-set state, and the images are managed through the states corresponding to the three dimensions of the image dimension, the test task dimension, and the release version dimension. The core logic of managing a number of images is to connect the operations that need to be completed by each image when it is in various states through the flow of states between various dimensions, thereby realizing the overall management of the image.

[0075] like Figure 6 As shown, Figure 6 The flowchart for managing the image is as follows: First, the management process is started from the start node, and then the user will perform the "upload image" operation to upload the initial image to the unverified module in the image center. It is worth mentioning that in the unverified module, it is necessary to determine whether to stop maintaining the image. If it is necessary to stop maintaining the initial image, the initial image will be regarded as a discarded image, thereby ending the operation of managing the discarded image; if it is necessary to continue to maintain the initial image, the initial image must be transferred to the verified module for verification, and it is again determined whether to stop maintaining the image. It is worth mentioning that the embodiment of the present application can also upload the verified image to the cloud disk.

[0076] Subsequently, the embodiment of the present application needs to determine whether the verified image needs to be tested. If it does not need to be tested, it can be published; if the verified image needs to be tested, the verified image needs to be submitted to the preset test list to obtain the image to be tested, so as to test the image to be tested using the test version pre-established by the user. If the test passes, the image can be published. It is understandable that when the test does not pass, the image is discarded. It is worth mentioning that after submitting the verified image to the preset test list, it is necessary to determine whether the image needs to be removed for testing. If removal testing is required, the verified image needs to be returned to the verified module for verification again.

[0077] Among them, the task execution sequence diagram corresponding to the image production task is as follows Figure 7As shown: Before receiving the task, TaskExecutor (i.e., a component for managing threads) needs to be initialized. After the initialization operation is completed, TaskExecutor can start receiving the image production task. In a specific implementation, the image production task can be received through API (Application Programming Interface) call, user interface operation or other methods. After receiving the image production task, TaskExecutor can add the image production task to the task waiting queue by calling the addTask algorithm (i.e., an algorithm for adding tasks) of TaskFactory (i.e., an algorithm for adding tasks to a task factory). The task waiting queue is used to store tasks to be processed to ensure that the image production task can be processed in sequence or according to a preset priority.

[0078] It is worth mentioning that after receiving a request to add a task, TaskFactory can first use the preset construction method to build a specific task instance. Then, it calls the execute method (a programming method for performing specific operations or tasks) to put the image production task into the preset task thread pool for execution. The task thread pool is a container for managing multiple threads, which can improve the efficiency of task execution and resource utilization.

[0079] In this embodiment, in the process of executing tasks, different task templates need to be used, wherein the task template defines the execution logic, parameters and dependencies of the task, so that TaskFactory creates a task template that matches the current image production task. After constructing the image production task template, ActionChainBuilder can build an action chain according to the information defined in the template. An action chain is a collection of operations or tasks that need to be performed in a specific order. Among them, the process of building an action chain involves parsing the template, replacing parameters and processing operations on dependencies. Finally, when the action chain is successfully built, the task execution process is also completed accordingly. At this point, the system has prepared a set of operations or image production tasks that are performed in a specific order, which can be used for subsequent triggering or use.

[0080] As can be seen from the above, after the image is made, the application needs to manage the image through the state machine technology, that is, using the state machine technology and based on the control signal, and according to the pre-set state, the image making task is transferred and operated accordingly, and the corresponding management operations are performed on a number of images through the states corresponding to the three dimensions of the image dimension, the test task dimension, and the release version dimension. Among them, the core logic of managing a number of images is to connect the operations that need to be completed by each image when it is in various states through the flow of states between the dimensions, so as to realize the overall management of the image. In this way, the speed of image production and the efficiency of project delivery involving images are improved, thereby improving the user experience.

[0081] Accordingly, see Figure 8 As shown, the present application also provides a mirror image making device, comprising:

[0082] The task creation module 11 is used to obtain the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user requirements and a preset production process;

[0083] The task placing module 12 is used to place the image making task into a preset waiting queue, so that the first preset task executor can place the image making task extracted from the preset waiting queue into a preset task thread pool, so that the second preset task executor can obtain the image making task from the preset task thread pool and execute it;

[0084] The task monitoring module 13 is used to monitor the execution status of the image making task, and if the execution status of the image making task is abnormal, perform a preset response operation on the image making task to obtain a target task to be executed;

[0085] The image archiving module 14 is used to obtain the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested and archive the target image that passes the test.

[0086] As can be seen from the above, before the image production is performed, the present application needs to obtain the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user needs and the preset production process; put the image production task into the preset waiting queue, so that the first preset task executor puts the image production task extracted from the preset waiting queue into the preset task thread pool, so that the second preset task executor obtains the image production task from the preset task thread pool and executes it; monitors the execution status of the image production task, and if the execution status of the image production task is an abnormal state, performs a preset response operation on the image production task to obtain the target task to be executed; obtains the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested, and archives the target image that passes the test. It can be seen that the present application puts the image production task into the preset waiting queue so that the first preset task executor extracts the image production task from the preset waiting queue and puts the image production task into the preset task thread pool, so that the second preset task executor can obtain the image production task from the preset task thread pool and perform the execution operation. At the same time, the execution status of the image production task is monitored. If the execution status of the image production task is abnormal, the preset response operation is performed on the image production task to obtain the target task to be executed, and the image to be tested obtained after the second preset task executor executes the target task to be executed. Finally, the image to be tested is tested, and the target image that passes the test is archived. In this way, the speed of image production and the efficiency of project delivery are improved, thereby improving the user experience.

[0087] In some specific embodiments, the image making device further includes:

[0088] A task execution unit, used to implement the image production task after execution through a preset task factory, so that the user can manually trigger the implemented image production task;

[0089] The task placing unit is used to place the manually triggered image production task back into the preset waiting queue, so that the first preset task executor extracts the image production task from the preset waiting queue and places the image production task into the preset task thread pool.

[0090] In some specific embodiments, the image making device further includes:

[0091] A first state changing unit, used to change the state corresponding to the image making task to a first task state;

[0092] Accordingly, in some specific embodiments, the image making device further includes:

[0093] A second state changing unit, used for updating the state corresponding to the image making task from the first task state to a second task state;

[0094] Accordingly, in some specific embodiments, the image making device further includes:

[0095] The third state changing unit is used to update the state corresponding to the image making task from the second task state to a third task state.

[0096] In some specific implementations, the task monitoring module 13 may specifically include:

[0097] The task detection subunit is used to monitor the execution status of the image production task. When an abnormal situation occurs in the image production task, the status corresponding to the image production task is updated from the third task status to the abnormal task status, and the second preset task executor is triggered to perform a task retry operation and a task rollback operation on the image production task, so that the first preset task executor puts the image production task back into the preset waiting queue after the task retry operation and the task rollback operation are completed.

[0098] In some specific embodiments, the image making device further includes:

[0099] The task numbering unit is used to number each of the image making tasks in ascending order based on the sequential dependency relationship between the image making tasks, so that the second preset task executor executes each of the image making tasks in sequence according to the numbering order.

[0100] In some specific embodiments, the image making device further includes:

[0101] The task interruption unit is used to interrupt the image making task and use a preset third-party service to asynchronously check the execution status of the current image making task and the execution status of the subtasks corresponding to the image making task.

[0102] In some specific embodiments, the image making device further includes:

[0103] The image operation unit is used to use a preset state machine technology and perform corresponding operations on the archived target images based on the dimensional states corresponding to the three dimensions, so as to manage the target images; wherein the dimensional states corresponding to different dimensions are different, and different dimensional states correspond to different operations; the three dimensions are respectively the image dimension, the test task dimension and the release version dimension.

[0104] Furthermore, the present application also discloses an electronic device. Fig. 9 It is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the mirror production method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0105] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0106] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0107] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the image making method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0108] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed mirror image production method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0109] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0110] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0111] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0112] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0113] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A mirror image making method, characterized in that: include: Obtaining the initial image uploaded by the user, and creating an image production task corresponding to the initial image based on user requirements and a preset production process; Put the image making task into a preset waiting queue, so that the first preset task executor puts the image making task extracted from the preset waiting queue into a preset task thread pool, so that the second preset task executor obtains the image making task from the preset task thread pool and executes it; The execution state of the image production task is monitored, and if the execution state of the image production task is an abnormal state, a preset response operation is performed on the image production task to obtain a target task to be executed; The image to be tested obtained after the second preset task executor executes the target task to be executed is obtained, so as to test the image to be tested, and archive the target image that passes the test.

2. The mirror image making method according to claim 1, characterized in that: After putting the image making task into a preset waiting queue so that the first preset task executor will extract the image making task from the preset waiting queue and put it into a preset task thread pool so that the second preset task executor can obtain the image making task from the preset task thread pool and execute it, it also includes: Implementing the image production task after execution through a preset task factory so that the user can manually trigger the implemented image production task; The manually triggered image making task is put back into the preset waiting queue, so that the first preset task executor extracts the image making task from the preset waiting queue and puts the image making task into the preset task thread pool.

3. The mirror image making method according to claim 2, characterized in that: After placing the image making task into a preset waiting queue, the method further includes: Changing the state corresponding to the image making task to a first task state; Correspondingly, after the first preset task executor puts the image making task extracted from the preset waiting queue into the preset task thread pool, it also includes: Updating the state corresponding to the image making task from the first task state to the second task state; Correspondingly, the image making task after execution is realized based on the preset factory so that the user can manually trigger the realized image making task, further comprising: The state corresponding to the image making task is updated from the second task state to the third task state.

4. The mirror image making method according to claim 3, characterized in that: The monitoring of the execution status of the image making task and, if the execution status of the image making task is an abnormal state, performing a preset response operation on the image making task includes: The execution status of the image production task is monitored. When an abnormal situation occurs in the image production task, the status corresponding to the image production task is updated from the third task status to the abnormal task status, and the second preset task executor is triggered to perform a task retry operation and a task rollback operation on the image production task, so that the first preset task executor puts the image production task back into the preset waiting queue after the task retry operation and the task rollback operation are completed.

5. The mirror image making method according to claim 4, characterized in that: Before performing the task retry operation and the task rollback operation on the image creation task, the method further includes: Based on the sequential dependency relationship between the image production tasks, the image production tasks are numbered in ascending order, so that the second preset task executor executes the image production tasks in sequence according to the numbering order.

6. The mirror image making method according to claim 1, characterized in that: After putting the image making task into a preset waiting queue so that the first preset task executor will extract the image making task from the preset waiting queue and put it into a preset task thread pool so that the second preset task executor can obtain the image making task from the preset task thread pool and execute it, it also includes: The image making task is interrupted, and a preset third-party service is used to asynchronously check the execution status of the current image making task and the execution status of the subtasks corresponding to the image making task.

7. The mirror image making method according to any one of claims 1 to 6, characterized in that: After archiving the target image that has passed the test, the following is also included: Using a preset state machine technology and based on the dimensional states corresponding to the three dimensions, corresponding operations are performed on the archived target images, so as to manage the target images; Among them, different dimensions correspond to different dimensional states, and different dimensional states correspond to different operations; the three dimensions are respectively an image dimension, a test task dimension, and a release version dimension.

8. A mirror image making device, characterized in that: include: A task creation module is used to obtain the initial image uploaded by the user, and create an image production task corresponding to the initial image based on user requirements and a preset production process; A task placing module, used for placing the image making task into a preset waiting queue, so that the first preset task executor can place the image making task extracted from the preset waiting queue into a preset task thread pool, so that the second preset task executor can obtain the image making task from the preset task thread pool and execute it; A task monitoring module is used to monitor the execution status of the image production task, and if the execution status of the image production task is an abnormal state, perform a preset response operation on the image production task to obtain a target task to be executed; The image archiving module is used to obtain the image to be tested obtained after the second preset task executor executes the target task to be executed, so as to test the image to be tested and archive the target image that passes the test.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the mirroring method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the mirroring method according to any one of claims 1 to 7 are implemented.