Task execution method and device between platforms, computer device and storage medium
By caching system images in the Docker engine and building an AI processing system using NAS mounted volumes and Kubernetes automated deployment tools, the compatibility and coupling issues in cross-platform task execution are resolved, achieving efficient cross-platform task execution and system image updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PING AN PROPERTY INSURANCE CO LTD
- Filing Date
- 2022-09-27
- Publication Date
- 2026-06-26
Smart Images

Figure CN115454533B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and cross-platform interaction technology, and in particular to a cross-platform task execution method, apparatus, computer device and storage medium. Background Technology
[0002] Cross-system collaboration and interaction is a common problem in the IT field. In most cases, systems can rely on HTTP requests for interaction and information synchronization. In high-reliability scenarios, message queues (MQ) and other message synchronization middleware have emerged as a means of inter-system interaction. This approach eliminates the need for both systems to consider the availability of the other's application or worry about being affected by related parties. However, this method relies on strong interaction between the two systems. In certain training platform interaction scenarios, such as when platform A only uses platform B's cluster machine resources and doesn't need B to concern itself with related logic and status, but only A needs to manage the relevant lifecycle, using MQ for interaction has limitations and inconveniences. The cumbersome interaction and incompatibility with the individual system designs may lead to unexpected problems.
[0003] How to achieve cross-platform execution of tasks without considering compatibility between multiple platforms, while keeping business logic and configuration resources highly separated across platforms, has become an urgent problem to be solved. Summary of the Invention
[0004] The purpose of this application is to provide a cross-platform task execution method, apparatus, computer device, and storage medium, so that when business logic and configuration resources are highly separated across platforms, cross-platform task execution can be achieved without considering the compatibility between multiple platforms, thus avoiding excessive coupling between multiple platforms.
[0005] To address the aforementioned technical problems, this application provides a cross-platform task execution method, employing the following technical solution:
[0006] A cross-platform task execution method includes the following steps:
[0007] Upon receiving the initial deployment instruction, a system image for the first platform is created, and the system image is cached in a preset Docker engine.
[0008] Obtain the machine resources of the second platform, deploy the Docker engine according to the machine resources and the preset automated deployment tool, and mount the preset NAS mount volume into the deployed Docker engine;
[0009] The system image and machine resources are obtained by acquiring pre-created AI processing tasks through the Docker engine and by identifying the different mount points corresponding to the system image and machine resources within the NAS mount volume.
[0010] The system image is used as the executable program, and the machine resources are used as the configuration program to complete the construction of the AI processing system;
[0011] The completed AI processing system is invoked, and the AI processing system is started to run the AI processing task, the task execution result is obtained, and the task execution result is stored in the NAS mounted volume.
[0012] Furthermore, the step of creating a system image for the first platform and caching the system image within a preset Docker engine specifically includes:
[0013] Execute the build command of the Docker engine to generate the system image for the first platform;
[0014] Execute the push command of the Docker engine to send the system image into the image repository of the Docker engine.
[0015] Furthermore, the automated deployment tool is a Kubernetes automated deployment tool, and the machine resources include: CPU configuration information, GPU configuration information, and memory configuration information. The steps of obtaining the machine resources of the second platform, deploying the Docker engine according to the machine resources and the preset automated deployment tool, and mounting the preset NAS mount volume into the deployed Docker engine specifically include:
[0016] The Docker engine is deployed according to the scheduling rules of the K8s automated deployment tool and the CPU configuration information, GPU configuration information and memory configuration information;
[0017] Obtain the configuration file of the Docker engine after deployment, parse the configuration file, and mount the NAS mount volume into the deployed Docker engine according to the parsing result. The configuration file is the .yaml configuration file corresponding to the deployed Docker engine.
[0018] Furthermore, after the step of mounting the NAS mount volume into the deployed Docker engine, the method further includes:
[0019] By executing storage space allocation instructions, storage space is allocated within the NAS mounted volume for the running results of the system image;
[0020] Set distinct mount points for the system image and the machine resources within the NAS mount volume.
[0021] Furthermore, the steps of invoking the completed AI processing system, starting the AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result in the NAS mounted volume specifically include:
[0022] Obtain the task execution result and perform transport stream processing on the task execution result according to the preset custom script in the system image;
[0023] The task execution results are cached in the storage space corresponding to the running results of the system image within the NAS mounted volume by means of a transport stream.
[0024] Furthermore, after the steps of invoking the constructed AI processing system, starting the AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result in the NAS mounted volume, the method further includes:
[0025] The first platform periodically scans the cached files within the NAS mounted volume using a preset scanner. The cached files include: the system image, the machine resources, and the task execution results.
[0026] If the system image is found to have changed, the file content corresponding to the system image is parsed, and the corresponding parsing result is returned to the first platform via an HTTP request. The program update command is then executed to rename the file content corresponding to the system image to .bak.
[0027] Furthermore, the method also includes:
[0028] Based on preset monitoring components, it is determined whether the AI processing task has undergone task requirement updates;
[0029] If the AI processing task undergoes a task requirement update, the business logic of the first platform is updated according to the updated requirement.
[0030] After the business logic update of the first platform is completed, a third command line is executed to update the system image of the updated first platform. This third command line is the Docker engine's commit command.
[0031] or,
[0032] After the business logic update of the first platform is completed, execute the first command line to regenerate the system image of the updated first platform;
[0033] Obtain the updated system image corresponding to the first platform, and cache the system image in the Docker engine to replace the original system image.
[0034] To address the aforementioned technical problems, this application also provides a cross-platform task execution device, which employs the following technical solution:
[0035] A cross-platform task execution device, comprising:
[0036] The system image acquisition module is used to create a system image for the first platform after receiving an initialization deployment instruction, and cache the system image in a preset Docker engine;
[0037] The configuration acquisition and deployment module is used to acquire the machine resources of the second platform, deploy the Docker engine according to the machine resources and the preset automated deployment tool, and mount the preset NAS mount volume into the deployed Docker engine;
[0038] The architecture resource acquisition module is used to acquire pre-created AI processing tasks through the Docker engine, and to acquire the system image and machine resources according to the different mount points corresponding to the system image and machine resources in the NAS mount volume;
[0039] The AI processing system construction module is used to use the system image as an executable program and the machine resources as a configuration program to complete the construction of the AI processing system.
[0040] The AI processing task execution module is used to call the constructed AI processing system, start the AI processing system to run the AI processing task, obtain the task execution result, and store the task execution result in the NAS mounted volume.
[0041] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0042] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the cross-platform task execution method described above.
[0043] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0044] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the cross-platform task execution method described above.
[0045] Compared with the prior art, the embodiments of this application have the following main advantages:
[0046] The cross-platform task execution method described in this application involves: obtaining a system image from a first platform and caching it within a Docker engine; obtaining machine resources from a second platform and deploying the Docker engine, mounting a pre-defined NAS volume within the deployed Docker engine; obtaining a pre-created AI processing task through the Docker engine, using the system image as the executable program and the machine resources as the configuration program to complete the construction of the AI processing system; calling the constructed AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result within the NAS volume. This application achieves cross-platform task execution under a highly separated cross-platform state of business logic and configuration resources through NAS volumes and the Docker engine, avoiding excessive coupling between multiple platforms. Attached Figure Description
[0047] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0049] Figure 2 A flowchart of an embodiment of the cross-platform task execution method according to this application;
[0050] Figure 3 yes Figure 2 A flowchart of a specific implementation of step 201 shown;
[0051] Figure 4 yes Figure 2 A flowchart of a specific implementation of step 202 shown;
[0052] Figure 5 yes Figure 2 A flowchart of a specific implementation of step 205 shown;
[0053] Figure 6A schematic diagram of a cross-platform task execution device according to an embodiment of the present application;
[0054] Figure 7 This is a schematic diagram of the structure of one embodiment of the mirror update module in this application;
[0055] Figure 8 A schematic diagram of the structure of an embodiment of the computer device according to this application. Detailed Implementation
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0057] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0058] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0059] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0060] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0061] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0062] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0063] It should be noted that the cross-platform task execution method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the cross-platform task execution device is generally set in the server / terminal device.
[0064] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0065] Continue to refer to Figure 2 The diagram illustrates a flowchart of an embodiment of a cross-platform task execution method according to this application. The cross-platform task execution method includes the following steps:
[0066] Step 201: Upon receiving the initial deployment instruction, create a system image for the first platform and cache the system image in the preset Docker engine.
[0067] In this embodiment, the step of creating a system image for the first platform and caching the system image in a preset Docker engine specifically includes: executing the build command of the Docker engine to generate a system image for the first platform; and executing the push command of the Docker engine to send the system image into the image repository of the Docker engine.
[0068] In this embodiment, the first platform generally refers to a platform that provides business logic for task processing.
[0069] In this embodiment, the first command line and the second command line can be obtained by user input, or they can be pre-encapsulated in the called method and executed by directly calling the corresponding method when used.
[0070] Taking property insurance platforms and car management platforms as examples, if a traffic accident occurs and compensation is needed for the damaged vehicle, in order to process the compensation, the corresponding business logic in the car management platform needs to be executed to obtain the vehicle information of the damaged vehicle, and the corresponding business logic in the property insurance platform also needs to be executed to process the compensation for the damaged vehicle. Since the complete compensation business logic involves at least two platforms, according to the original execution method, the business logic needs to be executed across platforms.
[0071] In this embodiment, only the business logic for obtaining vehicle information of damaged vehicles within the vehicle management platform needs to be obtained. The Docker engine's `build` command is used to generate the system image corresponding to this business logic, and then the Docker engine's `push` command is used to send the system image into the Docker engine's image repository for later use. At this point, the vehicle management platform provides the business logic for obtaining vehicle information, and the vehicle management platform is the first platform. Similarly, the business logic for claiming compensation for damaged vehicles within the property insurance platform is obtained. The Docker engine's `build` command is used to generate the system image corresponding to this business logic, and then the Docker engine's `push` command is used to send the system image into the Docker engine's image repository for later use. At this point, since the property insurance platform provides the business logic for claims processing, the property insurance platform is the first platform.
[0072] By using command lines, business logic is transformed into a corresponding system image, so that when actually executing a task, only the corresponding system image needs to be called to complete the task processing, which facilitates task execution.
[0073] Continue to refer to Figure 3 , Figure 3 yes Figure 2 A flowchart of a specific implementation of step 201 shown includes the following steps:
[0074] Step 301: Execute the build command of the Docker engine to generate the system image of the first platform;
[0075] Step 302: Execute the push command of the Docker engine to send the system image into the image repository of the Docker engine.
[0076] Step 202: Obtain the machine resources of the second platform, deploy the Docker engine according to the machine resources and the preset automated deployment tool, and mount the preset NAS mount volume into the deployed Docker engine.
[0077] In this embodiment, the automated deployment tool is a K8s automated deployment tool, and the machine resources include: CPU configuration information, GPU configuration information, and memory configuration information. The steps of obtaining the machine resources of the second platform, deploying the Docker engine according to the machine resources and the preset automated deployment tool, and mounting the preset NAS mount volume into the deployed Docker engine specifically include: deploying the Docker engine according to the scheduling rules of the K8s automated deployment tool and the CPU configuration information, GPU configuration information, and memory configuration information; obtaining the configuration file of the deployed Docker engine, parsing the configuration file, and mounting the NAS mount volume into the deployed Docker engine according to the parsing result, wherein the configuration file is the .yaml configuration file corresponding to the deployed Docker engine.
[0078] Continuing with the property insurance platform and the vehicle management platform as examples, if a traffic accident occurs and compensation is needed for the damaged vehicle, the system image corresponding to the business logic has already been obtained in step 201. At this time, it is also necessary to obtain the machine resources of the property insurance platform and the vehicle management platform, specifically the CPU configuration information, GPU configuration information, and memory configuration information, namely the processor configuration information, general-purpose processor configuration information, and memory card information, in order to obtain the configuration resource information that matches the system image obtained in step 201.
[0079] In this embodiment, machine resources are obtained directly using the K8s automated deployment tool, and then the Docker engine is deployed according to the scheduling rules preset by the K8s automated deployment tool and the machine resources. This is equivalent to deploying the system image used to complete the entire processing task into the execution container.
[0080] In this embodiment, after the system image used to complete the entire processing task is deployed into the execution container, the configuration file of the Docker engine after deployment is obtained and parsed. The configuration file is the .yaml file of the Docker engine. According to the parsing result, the preset NAS mount volume is mounted into the deployed Docker engine.
[0081] By acquiring the necessary machine resources for the system image, the system image is deployed into the execution container, and a NAS mount volume is added to the execution container. This ensures the integrity of the execution container, giving it both executable programs, configuration programs, and file storage space.
[0082] Continue to refer to Figure 4 , Figure 4 yes Figure 2 A flowchart of a specific implementation of step 202 shown includes the following steps:
[0083] Step 401: Deploy the Docker engine according to the scheduling rules of the K8s automated deployment tool and the CPU configuration information, GPU configuration information and memory configuration information;
[0084] Step 402: Obtain the configuration file of the Docker engine after deployment, parse the configuration file, and mount the NAS mount volume into the deployed Docker engine according to the parsing result. The configuration file is the .yaml configuration file corresponding to the deployed Docker engine.
[0085] In this embodiment, after the step of mounting the NAS mount volume into the deployed Docker engine, the method further includes: allocating storage space for the running results of the system image within the NAS mount volume by executing storage space allocation instructions; and setting distinct mount points for the system image and the machine resources within the NAS mount volume.
[0086] In this embodiment, the NAS mounted volume is a file storage volume. Storage space is pre-set within the NAS mounted volume for the system image execution results. Different mount points are set for the .bak file corresponding to the system image itself and the configuration file corresponding to the machine resources. This ensures that when processing tasks, the system can be generated and executed through the different mount points on the NAS mounted volume. After the system completes execution, the execution results are saved in the storage space.
[0087] Step 203: Obtain the pre-created AI processing task through the Docker engine, and obtain the system image and the machine resources according to the different mount points corresponding to the system image and the machine resources in the NAS mount volume.
[0088] Step 204: Use the system image as the executable program and the machine resources as the configuration program to complete the construction of the AI processing system.
[0089] Step 205: Invoke the completed AI processing system, start the AI processing system to run the AI processing task, obtain the task execution result, and store the task execution result in the NAS mounted volume.
[0090] In this embodiment, the steps of calling the constructed AI processing system, starting the AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result in the NAS mounted volume specifically include: obtaining the task execution result, performing transport stream processing on the task execution result according to a preset custom script in the system image; and caching the task execution result in the storage space corresponding to the running result of the system image in the NAS mounted volume through the transport stream method.
[0091] Since the NAS mounts a volume as a file storage volume, the task execution results are stored in the storage space using a transport stream method. The transport stream method can be either byte stream transmission or character stream transmission.
[0092] The storage space corresponding to the running results of the system image is stored in virtualized storage space to avoid excessive storage resources in the original platform database, which could easily cause excessive system load.
[0093] Continue to refer to Figure 5 , Figure 5 yes Figure 2 A flowchart of a specific implementation of step 205 shown includes the following steps:
[0094] Step 501: Obtain the task execution result and perform transport stream processing on the task execution result according to the preset custom script in the system image;
[0095] Step 502: Cache the task execution result to the storage space corresponding to the running result of the system image within the NAS mounted volume via a transport stream.
[0096] In this embodiment, after the steps of calling the constructed AI processing system, starting the AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result in the NAS mounted volume, the method further includes: the first platform periodically scanning the cached files in the NAS mounted volume using a preset scanner, wherein the cached files include: the system image, the machine resources, and the task execution result; if the system image is found to have changed, the file content corresponding to the system image is parsed, and the corresponding parsing result is returned to the first platform via an HTTP request, and a program update command is executed to rename the file content corresponding to the system image to .bak.
[0097] By using a pre-set scanner for scheduled scanning, changes in the business logic of the primary platform can be detected and updated promptly, ensuring the high availability of the system image.
[0098] In this embodiment, the cross-platform task execution method further includes the following steps: based on a preset monitoring component, determining whether the AI processing task has undergone task requirement updates; if the AI processing task has undergone task requirement updates, updating the business logic of the first platform according to the updated requirement content; after the business logic update of the first platform is completed, executing a third command line to update the system image of the updated first platform, wherein the third command line is a Docker engine commit command, or, after the business logic update of the first platform is completed, executing the first command line to regenerate the system image of the updated first platform; obtaining the system image corresponding to the updated first platform, and caching the system image in the Docker engine to replace the original system image.
[0099] By identifying whether the AI processing task has been updated, i.e., determining whether the system image needs to be regenerated, the system image is adapted to the new AI processing task, ensuring that the system image is updated in a timely manner when the AI processing task is updated.
[0100] This application obtains the system image of a first platform and caches it within a Docker engine; it acquires machine resources from a second platform, deploys the Docker engine, and mounts a pre-defined NAS mount volume into the deployed Docker engine; it then uses the Docker engine to obtain a pre-created AI processing task, using the system image as the executable program and the machine resources as the configuration program to complete the construction of the AI processing system; finally, it calls the constructed AI processing system to run the AI processing task, obtains the task execution result, and stores the result in the NAS mount volume. This application, through NAS mount volumes and the Docker engine, achieves cross-platform execution of tasks while maintaining a high degree of separation between business logic and configuration resources across platforms, avoiding excessive coupling between multiple platforms.
[0101] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0102] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0103] In this embodiment, artificial intelligence can be used to automatically acquire the business logic corresponding to multiple platforms to obtain the system image corresponding to the AI processing task. At the same time, artificial intelligence can also be used to monitor the system business logic and AI processing task, making it more intelligent and automated.
[0104] Further reference Figure 6 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a cross-platform task execution device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0105] like Figure 6 As shown, the cross-platform task execution device 600 described in this embodiment includes: a system image acquisition module 601, a configuration acquisition and deployment module 602, an architecture resource acquisition module 603, an AI processing system construction module 604, and an AI processing task execution module 605.
[0106] in:
[0107] The system image acquisition module 601 is used to create a system image of the first platform after receiving the initialization deployment instruction, and cache the system image in the preset Docker engine;
[0108] The configuration acquisition and deployment module 602 is used to acquire the machine resources of the second platform, deploy the Docker engine according to the machine resources and the preset automated deployment tool, and mount the preset NAS mount volume into the deployed Docker engine;
[0109] The architecture resource acquisition module 603 is used to acquire pre-created AI processing tasks through the Docker engine, and acquire the system image and machine resources according to the different mount points corresponding to the system image and the machine resources in the NAS mount volume;
[0110] AI processing system construction module 604 is used to use the system image as an executable program and the machine resources as a configuration program to complete the construction of the AI processing system;
[0111] AI processing task execution module 605 is used to call the constructed AI processing system, start the AI processing system to run the AI processing task, obtain the task execution result, and store the task execution result in the NAS mounted volume.
[0112] This application obtains the system image of a first platform and caches it within a Docker engine; it acquires machine resources from a second platform, deploys the Docker engine, and mounts a pre-defined NAS mount volume into the deployed Docker engine; it then uses the Docker engine to obtain a pre-created AI processing task, using the system image as the executable program and the machine resources as the configuration program to complete the construction of the AI processing system; finally, it calls the constructed AI processing system to run the AI processing task, obtains the task execution result, and stores the result in the NAS mount volume. This application, through NAS mount volumes and the Docker engine, achieves cross-platform execution of tasks while maintaining a high degree of separation between business logic and configuration resources across platforms, avoiding excessive coupling between multiple platforms.
[0113] Further reference Figure 7 In some specific embodiments of this application, the cross-platform task execution device 600 further includes: an image update module 606, which includes a first update submodule 6061 and a second update submodule 6062, wherein:
[0114] The first update submodule 6061 is used to periodically scan the cached files in the NAS mounted volume on the first platform using a preset scanner. The cached files include the system image, the machine resources, and the task execution results. If the system image is found to have changed, the content of the file corresponding to the system image is parsed, and the corresponding parsing result is returned to the first platform via an HTTP request. The program update command is then executed to rename the file content corresponding to the system image to .bak.
[0115] The second update submodule 6062 is used to determine, based on a preset monitoring component, whether the AI processing task has undergone a task requirement update; if the AI processing task has undergone a task requirement update, then the business logic of the first platform is updated according to the requirement update content; after the business logic update of the first platform is completed, a third command line is executed to update the system image of the updated first platform, wherein the third command line is the commit command of the Docker engine, or, after the business logic update of the first platform is completed, the first command line is executed to regenerate the system image of the updated first platform; the system image corresponding to the updated first platform is obtained, and the system image is cached in the Docker engine to replace the original system image.
[0116] The first update submodule can promptly send a message to the first platform when the system image sends an error change, and promptly obtain the files in the first platform to regenerate the system image. The second update submodule can promptly update the system image when the AI processing task changes. This ensures that the system image is updated in a timely manner when an error occurs, and also ensures that the system image is updated in a timely manner when the AI processing task changes.
[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0118] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0119] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.
[0120] The computer device 8 includes a memory 81, a processor 82, and a network interface 83 that are interconnected via a system bus. It should be noted that only the computer device 8 with components 81-83 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0121] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0122] The memory 81 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 81 may be an internal storage unit of the computer device 8, such as the hard disk or memory of the computer device 8. In other embodiments, the memory 81 may also be an external storage device of the computer device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 8. Of course, the memory 81 may include both the internal storage unit and its external storage device of the computer device 8. In this embodiment, the memory 81 is typically used to store the operating system and various application software installed on the computer device 8, such as computer-readable instructions for cross-platform task execution methods. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or will be output.
[0123] In some embodiments, the processor 82 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 82 is typically used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is used to execute computer-readable instructions stored in the memory 81 or to process data, for example, to execute computer-readable instructions of the cross-platform task execution method.
[0124] The network interface 83 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 8 and other electronic devices.
[0125] The computer device proposed in this embodiment belongs to the field of cross-platform interaction technology. This application obtains a system image from a first platform and caches it within a Docker engine; it obtains machine resources from a second platform, deploys the Docker engine, and mounts a pre-defined NAS mount volume into the deployed Docker engine; it obtains a pre-created AI processing task through the Docker engine, uses the system image as the executable program and the machine resources as the configuration program, and completes the construction of the AI processing system; it calls the constructed AI processing system to run the AI processing task, obtains the task execution result, and stores the task execution result in the NAS mount volume. This application, through NAS mount volumes and the Docker engine, achieves cross-platform execution of tasks while maintaining a high degree of separation between business logic and configuration resources across platforms, avoiding excessive coupling between multiple platforms.
[0126] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the cross-platform task execution method described above.
[0127] The computer-readable storage medium proposed in this embodiment belongs to the field of cross-platform interaction technology. This application obtains a system image from a first platform and caches it within a Docker engine; it obtains machine resources from a second platform, deploys the Docker engine, and mounts a pre-defined NAS mount volume into the deployed Docker engine; it obtains a pre-created AI processing task through the Docker engine, uses the system image as the executable program and the machine resources as the configuration program to complete the construction of the AI processing system; it calls the constructed AI processing system to run the AI processing task, obtains the task execution result, and stores the task execution result in the NAS mount volume. This application, through NAS mount volumes and the Docker engine, achieves cross-platform execution of tasks while maintaining a high degree of separation between business logic and configuration resources across platforms, avoiding excessive coupling between multiple platforms.
[0128] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of 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, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0129] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A cross-platform task execution method, characterized in that, Includes the following steps: Upon receiving the initial deployment instruction, a system image for the first platform is created, and the system image is cached in a preset Docker engine. The system acquires machine resources from a second platform, deploys the Docker engine based on these resources and a pre-defined automated deployment tool, and mounts a pre-defined NAS mount volume into the deployed Docker engine. The pre-defined NAS mount volume is a file storage volume. Storage space is allocated within the NAS mount volume for the running results of the system image by executing storage space allocation instructions. Furthermore, distinct mount points are set within the NAS mount volume for the system image and the machine resources. The system image and machine resources are obtained by acquiring pre-created AI processing tasks through the Docker engine and by identifying the different mount points corresponding to the system image and machine resources within the NAS mount volume. The system image is used as the executable program, and the machine resources are used as the configuration program to complete the construction of the AI processing system; The completed AI processing system is invoked, and the AI processing system is started to run the AI processing task, the task execution result is obtained, and the task execution result is stored in the NAS mounted volume.
2. The cross-platform task execution method according to claim 1, characterized in that, The step of creating a system image for the first platform and caching the system image within a preset Docker engine specifically includes: Execute the build command of the Docker engine to generate the system image for the first platform; Execute the push command of the Docker engine to send the system image into the image repository of the Docker engine.
3. The cross-platform task execution method according to claim 1, characterized in that, The automated deployment tool is a Kubernetes (K8s) automated deployment tool. The machine resources include CPU configuration information, GPU configuration information, and memory configuration information. The steps of obtaining the machine resources of the second platform, deploying the Docker engine based on the machine resources and the preset automated deployment tool, and mounting the preset NAS mount volume into the deployed Docker engine specifically include: The Docker engine is deployed according to the scheduling rules of the K8s automated deployment tool and the CPU configuration information, GPU configuration information and memory configuration information; Obtain the configuration file of the Docker engine after deployment, parse the configuration file, and mount the NAS mount volume into the deployed Docker engine according to the parsing result. The configuration file is the .yaml configuration file corresponding to the deployed Docker engine.
4. The cross-platform task execution method according to claim 1, characterized in that, The steps of calling the constructed AI processing system, starting the AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result in the NAS mounted volume specifically include: Obtain the task execution result and perform transport stream processing on the task execution result according to the preset custom script in the system image; The task execution results are cached in the storage space corresponding to the running results of the system image within the NAS mounted volume by means of a transport stream.
5. The cross-platform task execution method according to claim 4, characterized in that, After the steps of invoking the constructed AI processing system, starting the AI processing system to run the AI processing task, obtaining the task execution result, and storing the task execution result in the NAS mounted volume, the method further includes: The first platform periodically scans the cached files within the NAS mounted volume using a preset scanner. The cached files include: the system image, the machine resources, and the task execution results. If the system image is found to have changed, the file content corresponding to the system image is parsed, and the corresponding parsing result is returned to the first platform via an HTTP request. The program update command is then executed to rename the file content corresponding to the system image to .bak.
6. The cross-platform task execution method according to any one of claims 1 to 5, characterized in that, The method further includes: Based on preset monitoring components, it is determined whether the AI processing task has undergone task requirement updates; If the AI processing task undergoes a task requirement update, the business logic of the first platform is updated according to the updated requirement. After the business logic update of the first platform is completed, a third command line is executed to update the system image of the updated first platform. This third command line is the Docker engine's commit command. or, After the business logic update of the first platform is completed, execute the first command line to regenerate the system image of the updated first platform; Obtain the updated system image corresponding to the first platform, and cache the system image in the Docker engine to replace the original system image.
7. A cross-platform task execution device, characterized in that, include: The system image acquisition module is used to create a system image for the first platform after receiving an initialization deployment instruction, and cache the system image in a preset Docker engine; The configuration acquisition and deployment module is used to acquire machine resources of the second platform, deploy the Docker engine according to the machine resources and a preset automated deployment tool, and mount a preset NAS mount volume into the deployed Docker engine. The preset NAS mount volume is a file storage volume. Storage space is allocated within the NAS mount volume for the running results of the system image by executing storage space allocation instructions. The module also sets distinct mount points for the system image and the machine resources within the NAS mount volume. The architecture resource acquisition module is used to acquire pre-created AI processing tasks through the Docker engine, and to acquire the system image and machine resources according to the different mount points corresponding to the system image and machine resources in the NAS mount volume; The AI processing system construction module is used to use the system image as an executable program and the machine resources as a configuration program to complete the construction of the AI processing system. The AI processing task execution module is used to call the constructed AI processing system, start the AI processing system to run the AI processing task, obtain the task execution result, and store the task execution result in the NAS mounted volume.
8. A computer device, characterized in that, The method includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the cross-platform task execution method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the cross-platform task execution method as described in any one of claims 1 to 6.