Data processing method and related device

By standardizing the encoding of the original code file to generate the target execution file, the problem of low cross-platform execution efficiency of computing tasks in 6G network is solved, and efficient cross-platform computing task execution and resource utilization are achieved.

WO2025175759A1PCT designated stage Publication Date: 2025-08-28HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/120526
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-02-23
Filing Date
2024-09-24
Publication Date
2025-08-28

AI Technical Summary

Technical Problem

In 6G networks, there is a problem of inefficient execution of computing tasks when executing cross-platform, especially due to the diversity and heterogeneity of computing nodes, cross-platform execution files cannot achieve the same expected behavior.

Method used

Code blocks in the original code file are encoded in a normalized manner, and target execution files are generated, and the type and encoding format of the code block are indicated by segment identification and submodule options, ensuring that data sequences can be quickly determined and execution efficiency can be improved during cross-platform execution.

Benefits of technology

It realizes efficient operation of computing tasks when executed across platforms, reduces storage space and reduces transmission delay and bandwidth costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024120526_28082025_PF_FP_ABST
    Figure CN2024120526_28082025_PF_FP_ABST
Patent Text Reader

Abstract

A data processing method and a related device. The method comprises: obtaining an original code file (S210); on the basis of a compiling instruction, determining an encoding format corresponding to each code block in the original code file (S220); and on the basis of the encoding format corresponding to each code block, compiling at least one code block into a target execution file (S230), wherein the target execution file comprises at least one segment, each segment comprises a segment identifier and at least one sub-module, the segment identifier is used for indicating the type of a code block corresponding to the segment, the sub-module comprises a sub-module option and a sub-module code, the sub-module option is used for indicating an encoding format corresponding to the sub-module code, the sub-module code comprises at least one data sequence or identifier information corresponding to at least one data sequence, and each data sequence is determined on the basis of the encoding format indicated by the sub-module option and the corresponding code block. In the method, the code blocks are encoded in a standardized manner to generate the target execution file, thereby implementing the cross-platform operation of the target execution file, and improving the operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

A data processing method and related equipment

[0001] This application claims priority to the Chinese patent application with application number 202410204972.6 filed with the State Intellectual Property Office of China on February 23, 2024, and priority to the Chinese patent application with the invention name “A data processing method and related equipment”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computers, and more specifically, to a data processing method, device, chip system, computer-readable storage medium, and computer program product. Background Art

[0003] In the sixth generation mobile communication technology (6G) network, after the intelligent business is orchestrated and scheduled, the computing tasks will be widely distributed on any computing node of the 6G network, such as the computing nodes of the cloud, edge (edge ​​network), and terminal. Due to the mobility and dynamic characteristics of the 6G network and the tidal effect of the mobile network, computing tasks need to be able to migrate or scale horizontally between computing nodes. In addition, due to the diversity and heterogeneity of computing nodes (especially edge computing nodes and mobile terminals), and the general need for accelerators to accelerate the operation of artificial intelligence (AI) training and reasoning, computing tasks need to be executed across platforms, which includes cross-platform operation and / or physical processor instruction set architecture. However, in the prior art, there is usually a problem that the execution files used to execute computing tasks cannot be executed across platforms, or the execution files cannot achieve the same expected behavior when executed across platforms, resulting in low execution efficiency.

[0004] Therefore, how to improve the execution efficiency when computing tasks are executed across platforms has become an urgent problem to be solved.

[0005] Summary of the Invention

[0006] The present application provides a data processing method, apparatus, computing device, chip system, computer-readable storage medium, and computer program product, which can encode or run the code in the original code file in a standardized manner, thereby improving the execution efficiency when the computing task is executed across platforms.

[0007] In a first aspect, a data processing method is provided. The method includes: obtaining at least one original code file; determining, based on at least one compilation instruction, a coding format corresponding to each code block, the coding format corresponding to the code block being used to indicate the structure of the encoded code block; and compiling the at least one code block into a target executable file based on the coding format corresponding to each code block in the at least one code block.

[0008] The original code file includes at least one code block, each code block including at least one code statement. The target executable file includes at least one segment, each segment including a segment identifier and at least one submodule. Each submodule corresponds to a code block, and the code blocks corresponding to each submodule in each segment are of the same type. The segment identifier is used to indicate the type of code block corresponding to the segment. Each submodule includes a submodule option and a submodule code. The submodule option is used to indicate the encoding format corresponding to the submodule code. The submodule code includes at least one data sequence or identification information corresponding to at least one data sequence, and each data sequence in the at least one data sequence is determined based on the encoding format indicated by the submodule option and the corresponding code block.

[0009] In some embodiments, the compilation instructions include at least: converting the original code file to generate a target file, or linking one or more target files to generate a target execution file, or linking one or more target files and one or more original code files to generate a target execution file, etc.

[0010] In an embodiment of the present application, a compilation instruction indicates the encoding format corresponding to each code block, the code block is encoded as a submodule, the submodule option indicates the encoding format corresponding to the submodule in the submodule, and the submodules of the same type as the corresponding code block are set in the same section, thereby encoding at least one code block in a standardized manner, and then generating a target execution file. Because each submodule included in the target execution file is organized in a standardized form, when the target execution file is executed across platforms, the data sequence to be run in the target execution file can be determined relatively quickly, thereby running the data sequence, thereby improving the execution efficiency of the computing task.

[0011] In combination with the first aspect, in certain implementations of the first aspect, the compilation instruction corresponding to the first code block includes a first parameter, the sub-module option in the sub-module corresponding to the first code block includes a first option, the first option is the same as the first parameter, and the first code block belongs to at least one code block.

[0012] In an embodiment of the present application, the encoding format of the sub-module corresponding to the code block is determined through the compilation instructions corresponding to the code block, and the first option in the sub-module options of the sub-module is determined, so as to organize the data sequence after the code block is encoded in a standardized form, thereby facilitating the improvement of execution efficiency when executing the target file.

[0013] In combination with the first aspect, in certain implementations of the first aspect, when the sub-module option includes a first-category option, the sub-module code includes a data sequence, and the data sequence in the sub-module code is determined according to the encoding type indicated by the first-category option and the corresponding code block.

[0014] In some embodiments, when the first code block conforms to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the first code block. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is a sequence obtained after encoding the first code block according to the encoding type indicated by the first category option. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first category option. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block, or the first submodule corresponds to the first code block and the second code block.

[0015] Exemplarily, the first code block conforming to the first coding type means that the first code block is a data sequence encoded according to the first coding type. The first coding type is any coding type mentioned in the embodiments of the present application.

[0016] In an embodiment of the present application, the structure of the sub-module code is determined through the sub-module options, and the data sequence in the corresponding sub-module code is determined based on the encoding type indicated by the first type of options and the first code block, so that the data sequence and the first type of options are organized in a standardized manner to generate the sub-module corresponding to the code block.

[0017] In conjunction with the first aspect, in certain implementations of the first aspect, when the submodule options include the second category option, the submodule code includes at least one sequence type and a data sequence corresponding to each sequence type. The sequence type is used to indicate a coding type corresponding to a data sequence, and the data sequence is determined based on the coding type indicated by the sequence type and the corresponding code block.

[0018] In some embodiments, when the first code block conforms to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as that of the first code block. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is a sequence obtained by encoding the first code block according to the encoding type indicated by the first sequence type. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first sequence type. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block, or the first submodule corresponds to the first code block and the second code block. The first sequence type belongs to the at least one sequence type, and the first data sequence corresponds to the first sequence type.

[0019] In an embodiment of the present application, the first code block is encoded respectively by one or more sequence types to obtain one or more data sequences after the first code block is encoded, or the code block that conforms to the encoding type indicated by one or more sequence types is used as the corresponding data sequence, thereby providing multiple options for the computing node running the target execution file, so that the target execution file can adapt to more operating environments and achieve cross-platform operation.

[0020] In conjunction with the first aspect, in certain implementations of the first aspect, when the submodule option includes the third category option, the submodule code includes first identification information, or the submodule code includes the first identification information and at least one sequence type. The first identification information is used to indicate at least one data sequence corresponding to a code block corresponding to the submodule in the code database, and the sequence type is used to indicate a coding type corresponding to a data sequence.

[0021] In combination with the first aspect, in certain implementations of the first aspect, at least one data sequence corresponding to the first code block is determined based on at least one sequence type, each data sequence corresponds to a sequence type, and the first code block belongs to at least one code block; the at least one sequence type and the at least one data sequence corresponding to the first code block are transmitted to a code database to obtain first identification information of a submodule corresponding to the first code block.

[0022] In embodiments of the present application, the first code block is encoded using one or more sequence types, and / or a code block matching the encoding type indicated by the sequence type is searched based on the sequence type, thereby obtaining at least one data sequence. This provides multiple options for computing nodes running the target executable file, enabling the target executable file to run across platforms. Furthermore, the at least one data sequence encoded by the first code block does not need to be stored in the target executable file, thereby reducing the storage space occupied by the target executable file and facilitating transmission of the target executable file.

[0023] In combination with the first aspect, in certain implementations of the first aspect, the method is executed by a first computing node, and each sequence type of the at least one sequence type is a sequence type supported by the first computing node for generation.

[0024] In an embodiment of the present application, the first computing node determines at least one data sequence corresponding to the first code block based on the sequence type supported by the node, thereby providing more options for the computing node running the target executable file and facilitating cross-platform operation of the target executable file.

[0025] In combination with the first aspect, in certain implementations of the first aspect, when the first code block is an accelerator code block, the sub-module option in the first sub-module corresponding to the first code block also includes a second option, the first code block belongs to at least one code block, and the second option is used to indicate that the sub-module code in the first sub-module is an intermediate representation code or a device-related code. When the sub-module code is an intermediate representation code, the sub-module code is run by the accelerator after being translated into device-related code.

[0026] In an embodiment of the present application, the first code block can be directly encoded as device-specific code, thereby running on the accelerator. Alternatively, the first code block can be encoded as an intermediate representation code, thereby running on the accelerator after translation. This method can indicate the type of sub-module code in the first sub-module through the second option in the sub-module, thereby organizing the structure of the sub-module in a standardized form, thereby facilitating cross-platform operation of the sub-module.

[0027] In combination with the first aspect, in some implementations of the first aspect, the compilation instruction corresponding to the first code block further includes a second parameter, and the second parameter is the same as the second option.

[0028] In an embodiment of the present application, the encoding format of the sub-module corresponding to the code block is determined through the compilation instructions corresponding to the code block, and the second option in the sub-module option in the sub-module is determined, so as to organize the data sequence after the code block is encoded in a standardized form, thereby facilitating the improvement of execution efficiency when executing the target file.

[0029] In combination with the first aspect, in certain implementations of the first aspect, when one or more accelerator code blocks are included in at least one code block, the target execution file also includes an accelerator function segment, which is used to declare functions corresponding to one or more accelerator code blocks.

[0030] In the embodiment of the present application, when the original code file includes an accelerator code block, the target execution file may further declare the function in the accelerator code segment through the accelerator function segment.

[0031] In conjunction with the first aspect, in certain implementations of the first aspect, the code block type includes: an accelerator code block, an AI model code block, or a host shared library code block. The accelerator code block is used to run on an accelerator. The AI ​​model code block is used for training or inference of an AI model. The host shared library code block is used to assist in running the accelerator code block and / or the AI ​​model code block.

[0032] In a second aspect, a data processing method is provided, comprising: obtaining a target execution file; determining a data sequence to be executed corresponding to a submodule based on a segment identifier in the target execution file and a submodule option in the submodule; and executing the data sequence to be executed corresponding to the submodule.

[0033] The target execution file corresponds to at least one original code file, each original code file includes at least one code block, and each code block includes at least one code statement. The target execution file includes at least one segment, each segment includes a segment identifier and at least one submodule, and each submodule corresponds to a code block. The code blocks corresponding to each submodule in the segment are of the same type. The segment identifier is used to indicate the type of code block corresponding to the segment. Each submodule includes a submodule option and a submodule code. The submodule option is used to indicate the encoding format corresponding to the submodule code. The submodule code includes at least one data sequence or identification information corresponding to at least one data sequence, and each data sequence in the at least one data sequence is determined based on the encoding format indicated by the submodule option and the corresponding code block. The data sequence to be executed belongs to the at least one data sequence.

[0034] In an embodiment of the present application, since each sub-module included in the target execution file is organized in a standardized form, when the target execution file is executed across platforms, the data sequence to be run in the target execution file can be determined relatively quickly, thereby running the data sequence, thereby improving the execution efficiency of the computing task.

[0035] In conjunction with the second aspect, in certain implementations of the second aspect, when the submodule options include the first category option, the submodule code includes a data sequence. The data sequence in the submodule code is determined based on the encoding type indicated by the first category option and the corresponding code block. The data sequence in the submodule code is the data sequence to be executed.

[0036] In some embodiments, when the first code block conforms to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the first code block. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is a sequence obtained after encoding the first code block according to the encoding type indicated by the first category option. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first category option. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block, or the first submodule corresponds to the first code block and the second code block.

[0037] Exemplarily, the first code block conforming to the first coding type means that the first code block is a data sequence encoded according to the first coding type. The first coding type is any coding type mentioned in the embodiments of the present application.

[0038] In an embodiment of the present application, the structure in the sub-module code is determined through the sub-module option, so that the data sequence to be run can be directly determined from the sub-module code and run, thereby improving the efficiency of running the sub-module.

[0039] In conjunction with the second aspect, in certain implementations of the second aspect, when the submodule options include the second category option, the submodule code includes at least one sequence type and a data sequence corresponding to each sequence type. The sequence type is used to indicate a coding type corresponding to a data sequence, and the data sequence is determined based on the coding type indicated by the sequence type and the corresponding code block.

[0040] In some embodiments, when the first code block conforms to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as that of the first code block. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is a sequence obtained by encoding the first code block according to the encoding type indicated by the first sequence type. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first sequence type. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block, or the first submodule corresponds to the first code block and the second code block. The first sequence type belongs to the at least one sequence type, and the first data sequence corresponds to the first sequence type.

[0041] In conjunction with the second aspect, in certain implementations of the second aspect, when the submodule option includes the second type option, at least one sequence type included in the submodule code is determined based on the segment identifier and the encoding format indicated by the submodule option in the submodule. When the at least one sequence type included in the submodule code includes a preset sequence type, a data sequence corresponding to the preset sequence type is determined as the data sequence to be executed; when the at least one sequence type included in the submodule code does not include the preset sequence type, an alarm is issued.

[0042] In an embodiment of the present application, the submodule includes a data sequence that conforms to the encoding type indicated by each sequence type in at least one sequence type, so that the computing node running the submodule can select a suitable data sequence to run, thereby achieving cross-platform operation.

[0043] In conjunction with the second aspect, in certain implementations of the second aspect, when the submodule option includes the third category option, the submodule code includes first identification information, or the submodule code includes the first identification information and at least one sequence type. The first identification information is used to indicate at least one data sequence corresponding to a code block corresponding to the submodule in the code database, and the sequence type is used to indicate a coding type corresponding to a data sequence.

[0044] In combination with the second aspect, in certain implementations of the second aspect, when the sub-module option includes a third-category option, the first identification information is determined based on the segment identifier and the encoding format indicated by the sub-module option in the sub-module; when at least one data sequence indicated by the first identification information includes a data sequence corresponding to a preset sequence type, the data sequence corresponding to the preset sequence type is determined to be the data sequence to be run; when at least one data sequence indicated by the first identification information does not include a data sequence corresponding to the preset sequence type, an alarm is sent.

[0045] In an embodiment of the present application, a computing node running a submodule can determine a data sequence that can be run on the computing node from at least one data sequence indicated by the first identification information, thereby realizing cross-platform operation of the submodule.

[0046] In combination with the second aspect, in certain implementations of the second aspect, when the sub-module options include third-category options, when at least one data sequence corresponding to the first identification information is stored in the local storage space, at least one data sequence corresponding to the first identification information is obtained from the local storage space based on the first identification information; when at least one data sequence corresponding to the first identification information is not stored in the local storage space, the data sequence corresponding to the first identification information and the preset sequence type is obtained from the code database based on the first identification information and the preset sequence type, or an alarm is sent.

[0047] In this embodiment of the present application, the at least one data sequence encoded by the first code block can be stored in a computing node running the submodule corresponding to the first code block, or can be stored in a remote code database. When the data sequence is stored in the computing node, the transmission delay and bandwidth cost of obtaining the data sequence from the remote code database can be reduced.

[0048] In combination with the second aspect, in some implementations of the second aspect, the method is executed by the second computing node, and the preset sequence type is a sequence type supported by the second computing node.

[0049] In the embodiment of the present application, the second computing node can select a suitable data sequence to run from the sub-module according to the sequence type supported by the computing node, thereby realizing cross-platform operation of the sub-module.

[0050] In conjunction with the second aspect, in certain implementations of the second aspect, when the first code block is an accelerator code block, the submodule option in the first submodule corresponding to the first code block further includes a second option, the first code block belongs to at least one code block, and the second option is used to indicate that the submodule code in the first submodule is an intermediate representation code or a device-dependent code. When the submodule code is the intermediate representation code, the data sequence to be executed is translated into device-dependent code, and the device-dependent code corresponding to the data sequence to be executed is executed in the accelerator. When the submodule code is the device-dependent code, the data sequence to be executed is executed in the accelerator.

[0051] In an embodiment of the present application, whether the data sequence to be run needs to be translated can be determined based on the second option in the sub-module option, so that the computing node running the sub-module can run the data sequence to be run or the device-related code corresponding to the data sequence to be run on the accelerator based on the second option.

[0052] In conjunction with the second aspect, in certain implementations of the second aspect, the code block types include: accelerator code blocks, AI model code blocks, or host shared library code blocks. Accelerator code blocks are used to run on an accelerator. AI model code blocks are used for training or inference of AI models. Host shared library code blocks are used to assist in running accelerator code blocks and / or AI model code blocks.

[0053] According to a third aspect, a data processing device is provided, which includes a module for implementing the first aspect or any possible implementation manner of the first aspect.

[0054] In a fourth aspect, a data processing device is provided, which includes a module for implementing the second aspect or any possible implementation manner of the second aspect.

[0055] In a fifth aspect, a data processing system is provided, which includes the data processing device according to the third aspect and the data processing device according to the fourth aspect.

[0056] In a sixth aspect, a data processing device is provided, which includes a processor for executing instructions stored in a memory so that the data processing device is used to execute the method described in the first aspect, the second aspect, or any possible implementation of the first aspect or the second aspect.

[0057] In some embodiments, the data processing apparatus includes at least one computing device, each of the at least one computing device includes a processor, and the processor of the at least one computing device is used to execute instructions stored in a memory so that the data processing apparatus is used to execute the method described in the first aspect, the second aspect, or any possible implementation of the first aspect or the second aspect.

[0058] In the seventh aspect, a computing device cluster is provided, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster executes the method described in the first aspect, the second aspect, or any one of the implementation methods of the first aspect or the second aspect.

[0059] In an eighth aspect, a chip system is provided. The chip system includes a logic circuit, the logic circuit being configured to couple with an input / output interface and transmit data through the input / output interface to execute the method described in the first aspect, the second aspect, or any one of the implementations of the first aspect or the second aspect.

[0060] In the ninth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a data processing device, the data processing device executes the method described in the first aspect, the second aspect, or any one of the implementations of the first aspect or the second aspect.

[0061] In a tenth aspect, the present application provides a computer program product comprising instructions, which, when executed by a data processing device, causes the data processing device to execute the method described in the first aspect, the second aspect, or any one of the implementations of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] FIG1 is a schematic structural diagram of a data processing system according to an embodiment of the present application.

[0063] FIG2 is a schematic flowchart of a data processing method according to an embodiment of the present application.

[0064] FIG3 is a schematic structural diagram of a target execution file according to an embodiment of the present application.

[0065] FIG4 is a schematic structural diagram of a submodule according to an embodiment of the present application.

[0066] FIG5 is a schematic structural diagram of a submodule according to another embodiment of the present application.

[0067] FIG6 is a schematic structural diagram of a submodule according to another embodiment of the present application.

[0068] FIG7 is a schematic flowchart of a data processing method according to another embodiment of the present application.

[0069] FIG8 is a schematic flowchart of a data processing method according to another embodiment of the present application.

[0070] FIG9 is a schematic structural diagram of a data processing device according to an embodiment of the present application.

[0071] FIG10 is a schematic structural diagram of a computing device according to an embodiment of the present application.

[0072] FIG11 is a schematic structural diagram of a computing device cluster according to an embodiment of the present application.

[0073] FIG12 is a schematic diagram of a connection between computing devices 1000A and 1000B via a network according to one embodiment of the present application. DETAILED DESCRIPTION

[0074] The technical solution in this application will be described below with reference to the accompanying drawings.

[0075] The embodiments of the present application will present various aspects, embodiments, or features around a system including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these solutions may also be used.

[0076] Additionally, in the embodiments of this application, words such as "exemplary" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.

[0077] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field will know that with the evolution of technology and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0078] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0079] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0080] The technical solutions in the embodiments of the present application can be applied to computing devices, such as servers, hosts, personal computers, laptops, desktops, and other devices with computing capabilities. The server can be a local server or a cloud server, which is not limited in the embodiments of the present application. The technical solutions in the embodiments of the present application can also be applied to computing nodes in 6G networks, which can be deployed in the cloud, edge networks, or terminal devices.

[0081] In one technology, WebAssembly (Wasm) technology can perform computing tasks across operating systems and central processing unit (CPU) instruction set architectures, but Wasm cannot perform computing tasks across accelerator instruction set architectures. That is, Wasm cannot specify the encoding and loading methods of accelerator code and / or AI model code in a standardized manner, making it impossible for the compiler to generate a Wasm module containing accelerator code and / or AI model code in a standardized format, and also making it impossible for Wasm to perceive the accelerator code and / or AI model code in the Wasm module during runtime, thereby processing the accelerator code and / or AI model code in a standardized manner. When the loading and execution of accelerator code and / or AI model code requires a specific host shared library, Wasm cannot specify the encoding and loading methods of the host shared library code in a standardized manner, thereby failing to generate a Wasm module containing host shared library code in a standardized format. Because Wasm cannot load or run accelerator code, AI model code, or host shared library code in a standardized manner, Wasm modules generated by different compilers cannot achieve the same expected behavior at runtime, resulting in low execution efficiency of computing tasks.

[0082] Figure 1 is a schematic diagram of a data processing system according to an embodiment of the present application. The data processing system 100 in Figure 1 includes at least one of the following computing resource pools: a core network-side or cloud-side computing resource pool 110, an access network-side or edge-side computing resource pool 120, and a terminal-side computing resource pool 130.

[0083] In some embodiments, the data processing system 100 may include at least one core network-side or cloud-side computing resource pool 110. Alternatively, the data processing system 100 may include at least one access network-side or edge-side computing resource pool 120. Alternatively, the data processing system 100 may include at least one terminal-side computing resource pool 130.

[0084] The core network-side or cloud-side computing resource pool 110 can provide users with cloud infrastructure, allowing users to use the computing power, storage capacity, or cloud services provided by the core network-side or cloud-side computing resource pool 110 through leasing or other means, or allowing users to deploy computing models or private cloud services in the core network-side or cloud-side computing resource pool 110. The core network-side or cloud-side computing resource pool 110 includes at least one computing node, such as computing node 111 and / or computing node 112.

[0085] The access network side or edge side computing resource pool 120 is a resource pool built on the edge infrastructure based on cloud computing technology, virtualization technology or other computing technologies. The access network can be a radio access network (RAN) or a wired access network. The access network side or edge side computing resource pool 120 has computing, network, storage and other capabilities, and can form a "cloud-edge-end three-body collaboration" with the core network side or cloud side computing resource pool 110 and the terminal side computing resource pool 130. The access network side or edge side computing resource pool 120 can handle tasks such as network forwarding, storage, computing, and intelligent data analysis, and provide multiple groups of cloud services, thereby reducing response latency and bandwidth costs and alleviating pressure on the cloud. The access network side or edge side computing resource pool 120 includes at least one computing node, such as computing node 121 and / or computing node 122.

[0086] The terminal-side computing resource pool 130 includes a computing node, which can be a terminal device, or a chip or computing module in the terminal device. For example, the terminal-side computing resource pool 130 includes computing node 131 and / or computing node 132. The terminal-side computing resource pool 130 has computing, network, storage and other capabilities. The computing nodes in the terminal-side computing resource pool 130 are connected to the access network via wireless or wired means. The computing node is a device with wireless or wired transceiver functions, which can send signals to network devices or receive signals from network devices. The terminal device can refer to an access terminal, a subscriber unit, a user station, a mobile station (MS), a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a user equipment (UE), a wireless communication device, a user agent or a user device. The user device may also be a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a smart phone, a personal digital assistant (PDA), a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a car, a tablet computer, and sensors such as smart speakers, train detectors or gas stations, terminals in a 5G network, or any form of user equipment in a future network, etc., and the embodiments of the present application are not limited to this.

[0087] It should be noted that some computing nodes in the data processing system 100 are only used to execute computing tasks, and may also receive or execute the orchestration decisions and / or scheduling decisions of the orchestration function module and / or the scheduling function module, but are not used for development, compilation, debugging, and testing, etc. Alternatively, some computing nodes in the data processing system 100 are only used for development, compilation, debugging, and testing, etc., and are not used to execute computing tasks, nor do they receive or execute the orchestration decisions and / or scheduling decisions of the orchestration function module and / or the scheduling function module. Alternatively, some computing nodes in the data processing system 100 are used for development, compilation, debugging, and testing, etc., as well as for executing computing tasks, and may also receive or execute the orchestration decisions and / or scheduling decisions of the orchestration function module and / or the scheduling function module.

[0088] Exemplarily, computing nodes that can be used to execute computing tasks are also called execution nodes, that is, execution nodes include computing nodes that are only used to execute computing tasks and computing nodes that are used for development, compilation, debugging and testing as well as executing computing tasks.

[0089] Exemplarily, computing nodes that can be used for development, compilation, debugging and testing, etc. are also called development nodes, that is, development nodes include computing nodes that are only used for development, compilation, debugging and testing, etc. and computing nodes that are used for development, compilation, debugging and testing, etc. and also for executing computing tasks.

[0090] In some embodiments, the data processing system 100 also includes an orchestration function module and / or a scheduling function module. The orchestration function module is used to determine an orchestration decision, which is used to decompose a computing business into multiple computing tasks, or to allocate a range of resource pools or computing nodes to which a computing node belongs for a computing task. The scheduling function module is used to determine a scheduling decision, which is used to allocate a suitable computing node for computing tasks. The computing node is any computing node in the core network side or cloud side computing resource pool 110, the access network side or edge side computing resource pool 120, or the terminal side computing resource pool 130, for example, any execution node or any development node.

[0091] In some embodiments, some or all of the computing nodes in the data processing system 100 can be used to execute computing tasks, which can be specifically set by the owner or operation and maintenance personnel of the computing nodes, or determined by the orchestration function module or the scheduling function module. For example, the first computing service can be decomposed into one or more computing tasks, each of which can be executed in any one or more resource pools of the core network side or cloud side computing resource pool 110, the access network side or edge side computing resource pool 120, or the terminal side computing resource pool 130.

[0092] For example, since executing computing tasks in the core network side or cloud side computing resource pool 110 is likely to result in a large transmission delay, part of the computing tasks in the first computing service can be allocated to the access network side or edge side computing resource pool 120 for execution. Alternatively, since the computing nodes in the terminal side computing resource pool 130 are limited by power or computing power, part of the computing tasks in the first computing service are migrated to the access network side or edge side computing resource pool 120 for execution. Alternatively, with the switching of terminal devices or the migration of users, part of the computing tasks executed in the access network side or edge side computing resource pool 120 needs to be migrated from one computing node in the access network side or edge side computing resource pool 120 to another computing node for execution, or migrated from a computing node in one access network side or edge side computing resource pool to a computing node in another access network side or edge side computing resource pool.

[0093] In some embodiments, at least two computing nodes in the core network side or cloud side computing resource pool 110, the access network side or edge side computing resource pool 120, or the terminal side computing resource pool 130 have at least one different operating system, processor instruction set architecture, or accelerator instruction set architecture. When a computing task needs to be migrated to different resource pools for execution, since at least one of the operating systems, processor instruction set architectures, or accelerator instruction set architectures in different resource pools is different, it is easy to cause the computing task to be unable to be executed across platforms, or it is easy to cause the computing task to be unable to achieve the same expected behavior when executed across platforms. Alternatively, when a computing task needs to be migrated from one computing node in the same resource pool to another computing node for execution, since at least one of the operating systems, processor instruction set architectures, or accelerator instruction set architectures of different computing nodes in the same resource pool is different, it is easy to cause the computing task to be unable to be executed across platforms, or it is easy to cause the computing task to be unable to achieve the same expected behavior when executed across platforms.

[0094] Figure 2 is a schematic flow chart of a data processing method provided in an embodiment of the present application. The method in Figure 2 can be executed by a first computing node, which can be any development node in Figure 1. The method in Figure 2 includes the following steps.

[0095] S210: Obtain at least one original code file.

[0096] The first computing node may obtain at least one original code file, each of the at least one original code file including at least one code block. Each code block includes at least one code statement. The embodiments of the present application do not limit the code language used to write the original code file, such as C, C++, Rust, etc.

[0097] Exemplarily, the types of code blocks in the original code file include: accelerator code blocks, AI model code blocks, or some or all of the host shared library code blocks. Accelerator code blocks are used to run on an accelerator. AI model code blocks are used for training or inference of AI models. Host shared library code blocks are used to assist in running accelerator code blocks and / or AI model code blocks.

[0098] Illustratively, each code block may include part or all of a function, method, class, package, artificial neural network, etc.

[0099] Exemplarily, the host shared library code block includes a binary format code of machine instructions that is directly loaded into a physical processor. The machine instructions refer to an instruction set supported by the physical processor (e.g., CPU) or accelerator, such as the x86 instruction set (including i386, x86_64, etc.), the fifth-generation reduced instruction set computer (RISC-V) instruction set, the advanced reduced instruction set computer (ARM) instruction set (including ARMv1 to ARMv9, etc.), a graphics processing unit (GPU), a neural processing unit (NPU), a field programmable gate array (FPGA), and other accelerators.

[0100] Exemplarily, the machine instructions included in the host shared library code block are general instructions or instructions developed by a third party. The accelerator code block or AI model code block is code with specific functions developed by the developer of the original code file or a third party.

[0101] S220: Determine a coding format corresponding to each code block according to at least one compilation instruction.

[0102] After obtaining at least one original code file, the first computing node may compile the at least one original code file. During the compilation of the at least one original code file, the first computing node may determine the encoding format corresponding to each code block based on at least one compilation instruction. The encoding format corresponding to the code block indicates the structure of the encoded code block.

[0103] In some embodiments, the compilation instructions include at least: converting the original code file to generate a target file, or linking one or more target files to generate a target execution file, or linking one or more target files and one or more original code files to generate a target execution file, etc.

[0104] In some embodiments, a compilation directive may be used to indicate the encoding format corresponding to one or more code blocks.

[0105] Exemplarily, the compilation instruction includes a first parameter, where the first parameter is used to indicate an encoding format corresponding to the code block.

[0106] Exemplarily, the compilation instruction further includes a second parameter, which is used to indicate whether the data sequence corresponding to the code block is an intermediate representation code or a device-specific code. When the data sequence corresponding to the code block is an intermediate representation code, the data sequence must be translated into device-specific code before it can be executed by the accelerator.

[0107] For example, when the compilation instruction includes only the first parameter, the first parameter may be used only to indicate the encoding format corresponding to the code block. Alternatively, the first parameter may be used to indicate that the encoding format corresponding to the code block and the data sequence corresponding to the code block are intermediate representation codes or device-dependent codes.

[0108] Exemplarily, when the compilation instruction includes a first parameter and a second parameter, the first computing node determines that the data sequence corresponding to the code block is an intermediate representation code or a device-dependent code according to the second parameter, and then determines the encoding format corresponding to the code block according to the first parameter.

[0109] S230 , compile the at least one code block into a target executable file according to the encoding format corresponding to each code block in the at least one code block.

[0110] The first computing node compiles at least one code block into a target executable file based on the encoding format corresponding to each code block indicated by the compilation instruction. The target executable file includes at least one section, each section including a segment identifier and at least one submodule. Each submodule corresponds to a code block. The code blocks corresponding to each submodule in a section are of the same type. The segment identifier is used to indicate the type of code block corresponding to the section. Each submodule includes a submodule option and a submodule code. The submodule option is used to indicate the encoding format corresponding to the submodule code. The submodule code includes at least one data sequence or identification information corresponding to at least one data sequence, each of the at least one data sequence being determined based on the encoding format indicated by the submodule option and the corresponding code block.

[0111] For example, the target executable file is shown in Figure 3. Figure 3 is a schematic structural diagram of a target executable file 300 provided in an embodiment of the present application. As shown in Figure 3, the target executable file 300 includes at least one segment, such as segment 310 and / or segment 320. Segment 310 includes a segment identifier 311 and at least one submodule (e.g., submodule 312 and / or submodule 313). Segment identifier 311 is used to indicate the type of code block corresponding to each submodule in segment 310. In other words, the code block corresponding to each submodule in segment 310 is of the same type. Submodule 312 includes submodule option 1 and submodule code 1. Submodule 313 includes submodule option 2 and submodule code 2. Submodule option 1 and submodule option 2 can be the same or different, and this embodiment of the present application does not limit this. Segment 320 includes a segment identifier 321 and at least one submodule (e.g., submodule 322 and / or submodule 323). Segment identifier 321 is used to indicate the type of code block corresponding to each submodule in segment 320. The segment identifier 321 is different from the segment identifier 311. The submodule 322 includes a submodule option 3 and a submodule code 3. The submodule 323 includes a submodule option 4 and a submodule code 4. The submodule option 3 and the submodule option 4 can be the same or different, and this embodiment of the application does not limit this.

[0112] In some embodiments, the submodule options of a submodule include a first option, which is used to indicate the encoding format corresponding to the submodule code in the submodule. For example, assuming that the target executable file is shown in Figure 3, submodule option 1 in submodule 312 includes first option 1, submodule option 2 in submodule 313 includes first option 2, submodule option 3 in submodule 322 includes first option 3, and submodule option 4 in submodule 323 includes first option 4.

[0113] When the compilation instruction includes a first parameter, the first parameter in the compilation instruction corresponding to the first code block is the first option in the submodule option in the first submodule. The first code block is any one of the at least one code block, and the first submodule corresponds to the first code block.

[0114] Optionally, the submodule options may include any one of the first category options, the second category options or the third category options.

[0115] Exemplarily, the first type of options can be used to indicate a specific encoding type. For example, the first type of options can be used to indicate the type of a general intermediate representation, such as Standard Portable Intermediate Representation v (SPIR-V), Low Level Virtual Machine (LLVM) Intermediate Representation (IR) Subset 1, LLVM IR Subset 2, etc. The second and third types of options are used to indicate structures in submodule code. In other words, the encoding format indicated by the submodule option is a specific encoding type or a structure in the submodule code.

[0116] When the submodule options in the first submodule include first-category options, that is, when the first option in the submodule options is a first-category option, the submodule code in the first submodule includes a data sequence. The data sequence in the submodule code is determined based on the encoding type indicated by the first-category option and the first code block.

[0117] In some embodiments, when the first code block conforms to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the first code block. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is a sequence obtained after encoding the first code block according to the encoding type indicated by the first category option. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first category option. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block, or the first submodule corresponds to the first code block and the second code block.

[0118] Exemplarily, the first code block conforming to the first coding type means that the first code block is a data sequence encoded according to the first coding type. The first coding type is any coding type mentioned in the embodiments of the present application.

[0119] For example, the first submodule is shown in Figure 4. Figure 4 is a schematic structural diagram of a submodule 400 provided in an embodiment of the present application. Submodule 400 can be any of submodule 312, submodule 313, submodule 322, or submodule 323 in Figure 3. As shown in Figure 4, submodule 400 includes submodule options 410 and submodule code 420. Submodule options 410 include a first option 411, which is a first-category option. Submodule code 420 includes a data sequence 421. Data sequence 421 is determined based on the encoding type indicated by submodule option 410 and the code block corresponding to submodule 400. For example, when the code block corresponding to submodule 400 meets the encoding type indicated by first option 411, data sequence 421 is the same as the code block corresponding to submodule 400. Alternatively, when the code block corresponding to submodule 400 does not conform to the encoding type indicated by first option 411, data sequence 421 is a sequence obtained by encoding the code block corresponding to submodule 400 according to the encoding type indicated by first option 411. Alternatively, when the code block corresponding to submodule 400 does not conform to the encoding type indicated by first option 411, data sequence 421 is the same as a second code block. The function of the second code block is the same as that of the code block corresponding to submodule 400, and the second code block conforms to the encoding type indicated by first option 411. The second code block is at least one code block in the original code file.

[0120] When the submodule options in the first submodule include second-category options, that is, when the first option in the submodule options is a second-category option, the submodule code in the first submodule includes at least one sequence type and a data sequence corresponding to each sequence type. The sequence type is used to indicate the encoding type corresponding to a data sequence. The data sequence is determined based on the encoding type indicated by the corresponding sequence type and the first code block.

[0121] In some embodiments, when the first code block conforms to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as that of the first code block. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is a sequence obtained by encoding the first code block according to the encoding type indicated by the first sequence type. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first sequence type. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block, or the first submodule corresponds to the first code block and the second code block. The first sequence type belongs to the at least one sequence type, and the first data sequence corresponds to the first sequence type.

[0122] For example, the first submodule is shown in Figure 5. Figure 5 is a schematic structural diagram of submodule 500 provided in an embodiment of the present application. Submodule 500 can be any of submodule 312, submodule 313, submodule 322, or submodule 323 in Figure 3. As shown in Figure 5, submodule 500 includes submodule options 510 and submodule code 520. Submodule options 510 include a first option 511, which is a second-category option. Submodule code 520 includes at least one sequence type (e.g., sequence type 521 and / or sequence type 523) and a data sequence corresponding to each sequence type (e.g., data sequence 522 and / or data sequence 524). Sequence type 521 and sequence type 523 are different. Data sequence 522 is determined based on the encoding type indicated by sequence type 521 and the code block corresponding to submodule 500. Data sequence 524 is determined based on the encoding type indicated by sequence type 523 and the code block corresponding to submodule 500.

[0123] Taking data sequence 522 as an example, when the code block corresponding to submodule 500 conforms to the encoding type indicated by sequence type 521, data sequence 522 is the same as the code block corresponding to submodule 500. Alternatively, when the code block corresponding to submodule 500 does not conform to the encoding type indicated by sequence type 521, data sequence 522 is the sequence obtained by encoding the code block corresponding to submodule 500 according to the encoding type indicated by sequence type 521. Alternatively, when the code block corresponding to submodule 500 does not conform to the encoding type indicated by sequence type 521, data sequence 522 is the same as a second code block. The function of this second code block is the same as that of the code block corresponding to submodule 500, and the second code block conforms to the encoding type indicated by sequence type 521. This second code block belongs to at least one code block in the original code file. It should be understood that the method for determining data sequence 524 is similar to the method for determining data sequence 522 and will not be repeated here.

[0124] When the submodule options of the first submodule include third-category options, that is, when the first option in the submodule options is a third-category option, the submodule code of the first submodule includes first identification information, or the submodule code of the first submodule includes the first identification information and at least one sequence type. The first identification information is used to indicate at least one data sequence corresponding to the first code block in the code database. The sequence type is used to indicate the encoding type corresponding to a data sequence. The first submodule is shown in Figure 6.

[0125] FIG6 is a schematic structural diagram of a submodule 600 provided in an embodiment of the present application. Submodule 600 may be any of submodule 312, submodule 313, submodule 322, or submodule 323 in FIG3 . As shown in FIG6 , submodule 600 includes submodule options 610 and submodule code 620. Submodule options 610 include a first option 611, which is a third-category option. Submodule code 620 includes first identification information 621. Alternatively, submodule code 620 includes first identification information 621 and at least one sequence type (e.g., sequence type 622 and / or sequence type 623). The first identification information is used to indicate at least one data sequence corresponding to the code block corresponding to submodule 600 in a code database. Each data sequence in the at least one data sequence is determined based on the encoding type indicated by a sequence type and the code block corresponding to submodule 600. Sequence type 622 or sequence type 623 is the sequence type corresponding to a data sequence in the code database for the code block corresponding to submodule 600. The sequence type 622 is different from the sequence type 623 , and the data sequences corresponding to the sequence type 622 and the sequence type 623 are different.

[0126] For example, assume that the code block corresponding to submodule 600 includes data sequence 624 (not shown) in at least one data sequence corresponding to the code database, and that data sequence 624 corresponds to sequence type 622. When the code block corresponding to submodule 600 conforms to the encoding type indicated by sequence type 622, data sequence 624 is the same as the code block corresponding to submodule 600. Alternatively, when the code block corresponding to submodule 600 does not conform to the encoding type indicated by sequence type 622, data sequence 624 is the sequence obtained by encoding the code block corresponding to submodule 600 according to the encoding type indicated by sequence type 622. Alternatively, when the code block corresponding to submodule 600 does not conform to the encoding type indicated by sequence type 622, data sequence 624 is the same as a second code block. The function of this second code block is the same as that of the code block corresponding to submodule 600, and the second code block conforms to the encoding type indicated by sequence type 622. This second code block belongs to at least one code block in the original code file. It should be understood that the method for determining the other data sequences in the at least one data sequence except the data sequence 624 is similar to the method for determining the data sequence 624 and will not be repeated here.

[0127] Exemplarily, the first computing node determines, based on at least one sequence type, at least one data sequence corresponding to the first code block. Each data sequence corresponds to a sequence type. The first computing node transmits the at least one sequence type and the at least one data sequence corresponding to the first code block to a code database to obtain first identification information of the first submodule.

[0128] Exemplarily, the first computing node may transmit identification information of the first code block, at least one sequence type, and at least one data sequence corresponding to the first code block to a code database, thereby obtaining first identification information of the first submodule. The identification information of the first code block may be, for example, a name or number of the first code block.

[0129] Exemplarily, each of the at least one sequence type is a sequence type supported by the first computing node for generation. In other words, before S230, the first computing node determines the coding type indicated by each sequence type.

[0130] Exemplarily, some of the at least one sequence type are not sequence types supported by the first computing node. That is, data sequences corresponding to these sequence types cannot be run on the first computing node. Alternatively, each sequence type in the at least one sequence type is a sequence type supported by the first computing node. That is, data sequences corresponding to each sequence type can be run on the first computing node.

[0131] When the first code block is an accelerator code block, the submodule options in the first submodule also include a second option. The second option is used to indicate that the submodule code in the first submodule is an intermediate representation code or a device-dependent code. When the submodule code in the first submodule is an intermediate representation code, the submodule code is executed by the accelerator after being translated into device-dependent code. The first submodule is shown in Figure 3, Figure 4, Figure 5, or Figure 6. As shown in Figure 3, submodule option 1 in submodule 312 includes first option 1 and second option 1, submodule option 2 in submodule 313 includes first option 2 and second option 2, submodule option 3 in submodule 322 includes first option 3 and second option 3, and submodule option 4 in submodule 323 includes first option 4 and second option 4. As shown in Figure 4, submodule option 410 in submodule 400 includes first option 411 and second option 412. As shown in Figure 5, submodule 510 in submodule 500 includes first option 511 and second option 512. As shown in FIG. 6 , the submodule option 610 in the submodule 600 includes a first option 611 and a second option 612 .

[0132] When the compilation instruction includes a second parameter, the second parameter in the compilation instruction corresponding to the first code block is the same as the second option in the sub-module option in the first sub-module.

[0133] Optionally, in the target executable file, corresponding submodules with the same code block type are all located in the same segment.

[0134] Optionally, when at least one code block includes one or more accelerator code blocks, the target executable file also includes an accelerator function segment, where the accelerator function segment is used to declare functions corresponding to the one or more accelerator code blocks. The segment identifier of the accelerator function segment is different from the segment identifier of the segment including the submodule.

[0135] In an embodiment of the present application, a compilation instruction indicates the encoding format corresponding to each code block, the code block is encoded as a submodule, the submodule option indicates the encoding format corresponding to the submodule in the submodule, and the submodules of the same type as the corresponding code block are set in the same section, thereby encoding at least one code block in a standardized manner, and then generating a target execution file. Because each submodule included in the target execution file is organized in a standardized form, when the target execution file is executed across platforms, the data sequence to be run in the target execution file can be determined relatively quickly, thereby running the data sequence, thereby improving the execution efficiency of the computing task.

[0136] Figure 7 is a schematic flow chart of a data processing method provided by an embodiment of the present application. The method in Figure 7 is executed by a first computing node, which can be any development node in Figure 1. The method in Figure 7 includes the following steps.

[0137] S710: Determine a type of the first code block according to identification information or function of the first code block.

[0138] After obtaining at least one original code file, the first computing node traverses the code blocks in each original code file. After determining a first code block, the first computing node determines the type of the first code block based on identification information or function of the first code block. The first code block is any code block in the at least one original code file.

[0139] Exemplarily, the identification information of the first code block is used to identify the type of the first code block. The identification information is, for example, information such as the name or label of the code block.

[0140] Optionally, the first code block is of any of the following types: an accelerator code block, an AI model code block, or a host shared library code block. The accelerator code block is used to run on an accelerator. The AI ​​model code block is used for training or inference of an AI model. The host shared library code block is used to assist in running the accelerator code block and / or the AI ​​model code block.

[0141] S720: Determine, according to the type of the first code block, a segment in the target executable file where the first submodule corresponding to the first code block is located.

[0142] After determining the type of the first code block, the first computing node determines, based on the type of the first code block, a segment in the target executable file where the first submodule corresponding to the first code block is located.

[0143] The target executable file includes at least one segment, each segment including a segment identifier and at least one submodule. Each submodule corresponds to a code block. The code blocks corresponding to each submodule in each segment are of the same type. The segment identifier is used to indicate the type of code block corresponding to the segment. Each submodule includes a submodule option and a submodule code. The submodule option is used to indicate the encoding format corresponding to the submodule code. The submodule code includes at least one data sequence or identification information corresponding to the at least one data sequence. Each data sequence in the at least one data sequence is determined based on the encoding format indicated by the submodule option and the corresponding code block.

[0144] In some embodiments, submodules corresponding to code blocks of the same type in the at least one original code file are located in the same section.

[0145] For example, assume that the structure of the target execution file is as shown in Figure 3. Among them, the sub-modules corresponding to the accelerator code block in the at least one original file are all located in segment 310. The segment identifier 311 in segment 310 is used to indicate that segment 310 is an accelerator code segment, and the code block corresponding to each sub-module in the accelerator code segment is an accelerator code block. The sub-modules corresponding to the AI ​​model code block in the at least one original file are all located in segment 320. The segment identifier 321 in segment 320 is used to indicate that segment 320 is an AI model code segment, and the code block corresponding to each sub-module in the AI ​​model code segment is an AI model code block. The target execution file 300 may also include a segment 330 (not shown in the figure). The sub-modules corresponding to the host shared library code block in the at least one original code file are all located in segment 330. The segment identifier 331 in segment 330 (not shown in the figure) is used to indicate that segment 330 is a host shared library code segment, and the code block corresponding to each sub-module in the host shared library code segment is a host shared library code block. In other words, the target executable file includes at least one of the following segments: accelerator code segment, AI model code segment, and host shared library code segment.

[0146] In some embodiments, the target executable file further includes an accelerator function segment, wherein the accelerator function segment is used to declare a function corresponding to the accelerator code block in the at least one original file.

[0147] In some embodiments, the target executable file further includes at least one of the following segments: a custom segment, a type segment, an import segment, a function segment, a table segment, a memory segment, a global variable segment, an export segment, a start segment, an element segment, a code segment, a data segment, and a data count segment. The custom segment is used to provide custom extension functionality and is customized by the developer. The type segment is used to define types. The import segment is used to import functions, tables, memories, global variables, etc. The function segment is used to declare functions. The table segment is used to indicate the value of a specific element type. The memory segment is used to indicate a memory area. The global segment is used to declare global variables. The export segment is used to export functions, tables, memories, global variables, etc. The start segment is used to indicate the starting function index. The element segment is used to declare array initialization data. The code segment includes local variables and function bodies. The data segment is used to store data. The data count segment is used to indicate the length of data stored in the data segment.

[0148] Exemplarily, the target executable file is, for example, a Wasm module.

[0149] For example, the segments included in the target execution file are shown in Table 1.

[0150] Table 1 Segments included in the target execution file

[0151] As shown in Table 1, the target execution file includes 17 segments, each with a different segment identifier. For example, the target execution file includes some or all of the segments in Table 1. The embodiments of the present application do not limit the type or number of specific segments included in the target execution file.

[0152] It should be understood that the segment identifiers in Table 1 are merely exemplary, and the segment identifiers may also be represented by a combination of at least one character, including text, numbers, letters, symbols, and the like.

[0153] In some embodiments, the encoding format of the accelerator function segment and the function segment in the target executable file is the same.

[0154] In some embodiments, the target executable file does not include an accelerator function segment. When the target executable file does not include an accelerator function segment, the function segment is further used to declare the function corresponding to the accelerator code block in the at least one original file. In this case, the length of the vector included in the function segment is the sum of the length of the vector included in the code segment and the length of the vector included in the accelerator code segment. In other words, the number of functions declared in the function segment is the sum of the number of functions included in the code segment and the number of functions included in the accelerator code segment.

[0155] For example, assuming that the first code block is an accelerator code block, the target execution file includes an accelerator code segment, and the first submodule corresponding to the first code block is located in the accelerator code segment. Assuming that the first code block is an AI model code block, the target execution file includes an AI model code segment, and the first submodule corresponding to the first code block is located in the AI ​​model code segment. Assuming that the first code block is a host shared library code block, the target execution file includes a host shared library code segment, and the first submodule corresponding to the first code block is located in the host shared library code segment.

[0156] In some embodiments, the accelerator code segment is an accelerator code vector. The accelerator code vector includes at least one element, each element being a submodule.

[0157] Exemplarily, the accelerator code vector also includes a vector length. The vector length is used to indicate the number of submodules in the accelerator code vector. Exemplarily, the vector length is represented by an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0158] Exemplarily, each element (i.e., each submodule) in the accelerator code vector includes: a submodule option and a submodule code. The submodule option includes a first option, which is used to indicate the encoding format corresponding to the submodule code. The first option is represented by one byte.

[0159] Exemplarily, the submodule option also includes a second option. The second option is used to indicate that the submodule code is an intermediate representation code or a device-dependent code. The second option is represented by one byte.

[0160] Exemplarily, each element (i.e., each submodule) in the accelerator code vector also includes a submodule code length. The submodule code length is used to indicate the length of the submodule code. The submodule code length is expressed in bytes and is represented by an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0161] In some embodiments, the AI ​​model code segment is an AI model vector. The AI ​​model vector includes at least one element, each element being a submodule.

[0162] Exemplarily, the AI ​​model vector also includes a vector length. The vector length is used to indicate the number of submodules in the AI ​​model vector. Exemplarily, the vector length is represented by an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0163] Exemplarily, each element (i.e., each submodule) in the AI ​​model vector includes: a submodule option and a submodule code. The submodule option includes a first option, which is used to indicate the encoding format corresponding to the submodule code. The first option is represented by one byte.

[0164] Exemplarily, each element (i.e., each submodule) in the AI ​​model vector also includes second identification information. The second identification information is used to indicate the name or number of the code block corresponding to the submodule. The second identification information is represented by a byte vector. The byte vector is a vector formed by taking each byte of the corresponding data as an element.

[0165] Exemplarily, each element (i.e., each submodule) in the AI ​​model vector also includes: a submodule code length. The submodule code length is used to indicate the length of the submodule code. The submodule code length is expressed in bytes as an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0166] In some embodiments, the host shared library code segment is a host shared library code vector. The host shared library code vector includes at least one element, each element being a submodule.

[0167] Exemplarily, the host shared library code vector also includes a vector length. The vector length is used to indicate the number of submodules in the host shared library code vector. Exemplarily, the vector length is represented by an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0168] Exemplarily, each element (i.e., each submodule) in the host shared library code vector includes: a submodule option and a submodule code. The submodule option includes a first option, which is used to indicate the encoding format corresponding to the submodule code. The first option is represented by one byte.

[0169] Exemplarily, each element (i.e., each submodule) in the host shared library code vector also includes second identification information. The second identification information is used to indicate the name or number of the code block corresponding to the submodule. The second identification information is represented by a byte vector. The byte vector is a vector formed by taking each byte of the corresponding data as an element.

[0170] Illustratively, each element (i.e., each submodule) in the host shared library code vector further includes a submodule code length. The submodule code length is used to indicate the length of the submodule code. The submodule code length is expressed in bytes and is represented by an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0171] S730: Determine a first option in sub-module options of a first sub-module according to a first parameter in the first compile instruction.

[0172] After the first computing node determines the segment where the first submodule corresponding to the first code block is located in the target execution file, the first computing node determines the encoding format corresponding to the first code according to the first compilation instruction corresponding to the first code block, that is, determines the structure of the first submodule.

[0173] Optionally, the first compilation instruction includes a first parameter. The first parameter is used to indicate a first option in the submodule options of the first submodule. In other words, the first option in the submodule options of the first submodule is the same as the first parameter.

[0174] Optionally, the first parameter is any one of the following: first-category options, second-category options, and third-category options. That is, the first option in the submodule options of the first submodule is any one of the following: first-category options, second-category options, and third-category options.

[0175] In some embodiments, the first-category option is used to indicate a specific encoding type. For example, the first-category option is the name of an encoding type. Alternatively, the first-category option is the index of an encoding type in a first encoding type set. The first encoding type set includes at least one encoding type. The first-category option can be represented by at least one character. The at least one character includes: text, numbers, letters, symbols, etc.

[0176] For example, the first category of options is any one of the following: SPIR-V, LLVM IR 1, LLVM IR 2, etc., where LLVM IR 1 and LLVM IR 2 are merely exemplary names of LLVM IR subsets or full sets, and the embodiments of the present application do not limit the names of specific encoding types.

[0177] For example, the first encoding type set is shown in Table 2.

[0178] Table 2: First encoding type set

[0179] As shown in Table 2, the first encoding type set includes encoding type 1, encoding type 2, and encoding type 3. When the first type option is 1, the first type option is used to indicate encoding type 1. When the first parameter is 1, the first option in the submodule option of the first submodule is 1, and the submodule code in the first submodule is determined according to encoding type 1 and the first code block.

[0180] It should be understood that encoding type 1, encoding type 2, and encoding type 3 in Table 2 are different encoding types. Encoding type 1 to encoding type 3 can be any one of SPIR-V, LLVM IR 1, and LLVM IR 2, where LLVM IR 1 and LLVM IR 2 are only exemplary names of LLVM IR subsets or full sets. Alternatively, one or more of encoding type 1 to encoding type 3 are custom encoding types. It should also be understood that Table 2 is only a possible example of the first encoding type set. The index in Table 2 can be expressed as a combination of at least one character. The at least one character includes: text, numbers, letters, symbols, etc. It should also be understood that the encoding types in Table 2 can also include more encoding types, and the embodiments of the present application do not limit the specific type, index, name, or number of the encoding types.

[0181] In some embodiments, the second-category option is used to indicate that the submodule code of the first submodule includes at least one sequence type and a data sequence corresponding to each sequence type. The sequence type indicates the encoding type corresponding to a data sequence, and the data sequence is determined based on the encoding type indicated by the sequence type and the corresponding code block. The second-category option can be represented by at least one character. The at least one character includes text, numbers, letters, symbols, and the like.

[0182] For example, assume that the second type of option is represented by 11. When the first parameter is 11, the first option in the submodule options of the first submodule is 11, and the submodule code in the first submodule includes at least one sequence type and a data sequence corresponding to each sequence type.

[0183] In some embodiments, the third category of options is used to indicate that the submodule code of the first submodule includes first identification information. Alternatively, the third category of options is used to indicate that the submodule code of the first submodule includes the first identification information and at least one sequence type. The first identification information indicates at least one data sequence corresponding to the code block corresponding to the submodule in the code database. The sequence type indicates the encoding type corresponding to a data sequence. The third category of options can be represented by at least one character. The at least one character includes text, numbers, letters, symbols, etc.

[0184] For example, assume that the third category option is represented by 12. When the first parameter is 12, the first option in the submodule options of the first submodule is 12, and the submodule code in the first submodule includes the first identification information. Assume that the third category option is represented by 13. When the first parameter is 13, the first option in the submodule options of the first submodule is 13, and the submodule code in the first submodule includes the first identification information and at least one sequence type.

[0185] In some embodiments, each of the at least one sequence type is a sequence type supported by the first computing node. That is, the first computing node may encode the first code block according to the encoding type indicated by each sequence type, thereby obtaining at least one data sequence in the sub-module code of the first sub-module. Furthermore, / or, the first computing node may determine a code block that conforms to the encoding type indicated by each sequence type, and whose function is the same as that of the first code block, thereby obtaining at least one data sequence in the sub-module code of the first sub-module.

[0186] Exemplarily, each sequence type is a sequence type preset by the first computing node, or each sequence type is a sequence type specified by a developer.

[0187] Exemplarily, each of the at least one sequence type is a sequence type supported by the first computing node. That is, the first computing node can execute a data sequence encoded according to the encoding type indicated by each sequence type. Alternatively, one or more of the at least one sequence type is a sequence type not supported by the first computing node. That is, the first computing node cannot execute a data sequence encoded according to the encoding type indicated by the one or more sequence types.

[0188] Optionally, when the first code block is an accelerator code block, the first compilation instruction further includes a second parameter. The second parameter is used to indicate that the submodule code of the first submodule is an intermediate representation code or a device-dependent code. The second parameter is the same as the second option in the submodule option of the first submodule. The second option is used to indicate that the submodule code of the first submodule is an intermediate representation code or a device-dependent code. When the submodule code is an intermediate representation code, the submodule code is executed by the accelerator after being translated into device-dependent code. The accelerator is an accelerator adapted to the data sequence, that is, the accelerator can parse and execute the device-dependent code corresponding to the submodule code.

[0189] Optionally, the first computing node may execute S740 after S730 or before S730.

[0190] S740: Determine a second option in the sub-module options of the first sub-module according to the second parameter in the first compilation instruction.

[0191] After determining that the first code block is an accelerator code block, the first computing node determines a second option in the submodule options of the first submodule based on a second parameter in the first compilation instruction. The second option is the same as the second parameter. The second parameter is used to indicate whether the submodule code of the first submodule is an intermediate representation code or a device-dependent code.

[0192] In some embodiments, the intermediate representation code or the device-dependent code is represented by at least one character, which includes text, numbers, letters, symbols, etc.

[0193] For example, suppose the intermediate representation code is represented by 21. When the second parameter is 21, the second option in the submodule options of the first submodule is 21, and the submodule code of the first submodule is the intermediate representation code. Suppose the device-dependent code is represented by 22. When the second parameter is 22, the second option in the submodule options of the first submodule is 22, and the submodule code of the first submodule is the device-dependent code.

[0194] Optionally, the first computing node determines the specific encoding type indicated by the first option in the submodule options of the first submodule based on the second option in the submodule options of the first submodule. That is, different second options result in different encoding types indicated by the first option.

[0195] For example, assume that the first option in the submodule options of the first submodule is a first-category option, and the value of the first option is 1. When the second option indicates that the submodule code of the first submodule is an intermediate representation code, the encoding type indicated by the first option is encoding type 1. When the second option indicates that the submodule code of the first submodule is a device-dependent code, the encoding type indicated by the first option is encoding type 2.

[0196] Optionally, the first computing node does not need to determine the specific encoding type indicated by the first option in the submodule options of the first submodule based on the second option in the submodule options of the first submodule. That is, different second options do not affect the encoding type indicated by the first option. It should be noted that different second options correspond to different values ​​of the first option to avoid confusion.

[0197] For example, assume that the first option in the submodule options of the first submodule is a first-category option, and the value of the first option is 1. When the second option indicates that the submodule code of the first submodule is an intermediate representation code, the encoding type indicated by the first option is encoding type 1. When the second option indicates that the submodule code of the first submodule is a device-dependent code, the encoding type indicated by the first option is encoding type 1.

[0198] Exemplarily, when the second option indicates that the submodule code of the first submodule is an intermediate representation code, the first option in the submodule options of the first submodule is a first-category option. When the second option indicates that the submodule code of the first submodule is a device-dependent code, the first option in the submodule options of the first submodule is a second-category option or a third-category option.

[0199] S750: Determine a submodule code in the first submodule according to the submodule option of the first submodule.

[0200] After determining the submodule option of the first submodule, the first computing node determines the structure of the submodule code in the first submodule based on the encoding format indicated by the submodule option of the first submodule. After determining the structure of the submodule code, the first computing node determines at least one data sequence in the submodule code or identification information corresponding to the at least one data sequence based on the encoding type indicated by the submodule option or sequence type.

[0201] Optionally, when the first option in the sub-module options of the first sub-module is a first-category option, the sub-module code includes a data sequence.

[0202] When the first code block conforms to the encoding type indicated by the first type of option, the submodule code in the first submodule includes the same data sequence as the first code block. That is, the first computing node uses the first code block as the data sequence in the submodule code. The first submodule corresponds to the first code block.

[0203] When the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the sequence obtained by encoding the first code block according to the encoding type indicated by the first category option. That is, the first computing node encodes the first code block according to the encoding type indicated by the first category option, thereby determining the data sequence in the submodule code. Alternatively, when the first code block does not conform to the encoding type indicated by the first category option, the data sequence included in the submodule code in the first submodule is the same as that of the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first category option. That is, the first computing node searches the original code file for the second code block and uses the second code block as the data sequence in the submodule code. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block and the second code block.

[0204] Exemplarily, the first code block conforming to the first coding type means that the first code block is a data sequence encoded according to the first coding type. The first coding type is any coding type mentioned in the embodiments of the present application.

[0205] Optionally, when the first option in the sub-module options of the first sub-module is a second-category option, the sub-module code includes at least one sequence type and a data sequence corresponding to each sequence type.

[0206] When the first code block conforms to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code of the first submodule is the same as the first code block. That is, the first computation node uses the first code block as the first data sequence in the submodule code. The first sequence type belongs to at least one sequence type in the submodule code, and the first data sequence corresponds to the first sequence type. The first submodule corresponds to the first code block.

[0207] When the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the sequence obtained by encoding the first code block according to the encoding type indicated by the first sequence type. That is, the first computing node encodes the first code block according to the encoding type indicated by the first sequence type, thereby determining the first data sequence. Alternatively, when the first code block does not conform to the encoding type indicated by the first sequence type, the first data sequence included in the submodule code in the first submodule is the same as the second code block. The function of the second code block is the same as that of the first code block, and the second code block conforms to the encoding type indicated by the first sequence type. That is, the first computing node searches for the second code block in the original code file and uses the second code block as the first data sequence in the submodule code. The first code block and the second code block belong to at least one code block in the original code file. The first submodule corresponds to the first code block and the second code block.

[0208] In some embodiments, the sequence type included in the submodule code is the name of a coding type. Alternatively, the sequence type included in the submodule code is the index of a coding type in a second coding type set. The second coding type set includes at least one coding type. The sequence type can be represented as a combination of at least one character. The at least one character includes: text, numbers, letters, symbols, etc.

[0209] For example, the sequence type is any one of the following: intermediate representation 1, intermediate representation 2, machine instruction 1, machine instruction 2, etc.

[0210] For example, the second encoding type set is shown in Table 3.

[0211] Table 3 Second encoding type set

[0212] As shown in Table 3, the second encoding type set includes encoding type 4, encoding type 5, and encoding type 6. When the sequence type is 1, the sequence type is used to indicate encoding type 4. When the sequence type is 1, the data sequence corresponding to the sequence type is a data sequence that complies with encoding type 4.

[0213] It should be understood that encoding type 4, encoding type 5, and encoding type 6 in Table 3 are different encoding types. One or more of encoding type 4, encoding type 5, and encoding type 6 are encoding types defined by a specific manufacturer or organization, or are user-defined encoding types. It should also be understood that Table 3 is only one possible example of a second encoding type set. The index in Table 3 can be expressed as a combination of at least one character. The at least one character includes: text, numbers, letters, symbols, etc. It should also be understood that the encoding types in Table 3 can also include more encoding types, and the embodiments of the present application do not limit the specific types, indexes, names, or quantities of the encoding types.

[0214] In some embodiments, the submodule code is a submodule code vector, which includes at least one element, each element including a sequence type and a data sequence corresponding to the sequence type.

[0215] Exemplarily, the sequence type is represented by an integer, which is any one of the following: an 8-bit unsigned integer, a 16-bit unsigned integer, a 32-bit unsigned integer, or a 64-bit unsigned integer.

[0216] Illustratively, each element in the submodule code vector further includes a data sequence length. The data sequence length is used to indicate the length of the data sequence in each element. The data sequence length is expressed in bytes and is represented by an integer. The integer is, for example, a 32-bit or 64-bit unsigned integer.

[0217] Exemplarily, the data sequence is represented as a byte vector, which is a vector formed by taking each byte in the data sequence as an element.

[0218] Optionally, when the first option in the submodule options of the first submodule is a third-category option, the submodule code includes the first identification information. Alternatively, the submodule code includes the first identification information and at least one sequence type.

[0219] In some embodiments, the first computing node determines at least one data sequence corresponding to the first code block based on at least one sequence type, where each data sequence corresponds to a sequence type. The first computing node transmits the at least one sequence type and the at least one data sequence corresponding to the first code block to a code database to obtain first identification information of a submodule corresponding to the first code block.

[0220] When the first code block conforms to the encoding type indicated by the first sequence type, the first computing node uses the first code block as a first data sequence corresponding to the first code block. The first data sequence corresponds to a first sequence type, and the first sequence type belongs to the at least one sequence type.

[0221] When the first code block does not conform to the encoding type indicated by the first sequence type, the first computing node encodes the first code block according to the encoding type indicated by the first sequence type, thereby determining the first data sequence. Alternatively, the first computing node searches for a second code block from the original code file and uses the second code block as the first data sequence corresponding to the first code block. The second code block has the same function as the first code block, and the second code block conforms to the encoding type indicated by the first sequence type.

[0222] Exemplarily, the first computing node transmits a two-tuple list corresponding to the first code block to a code database, thereby obtaining first identification information corresponding to the first code block from the code database. The two-tuple list includes at least one two-tuple, each two-tuple including a sequence type and a data sequence corresponding to the sequence type.

[0223] Exemplarily, the first computing node transmits the identification information of the first code block and a list of two-tuples corresponding to the first code block to a code database, thereby obtaining the first identification information corresponding to the first code block. Alternatively, the first computing node transmits a list of three-tuples corresponding to the first code block to the code database, thereby obtaining the first identification information corresponding to the first code block. The list of three-tuples includes at least one triple, each triple including the identification information of the first code block, a sequence type, and a data sequence corresponding to the sequence type.

[0224] Exemplarily, the identification information of the first code block is the name or number of the first code block.

[0225] Exemplarily, the code database includes at least one data sequence corresponding to each code block in one or more code blocks.

[0226] Exemplarily, the first computing node remotely accesses the code database via a network. In other words, the first computing node uploads at least one sequence type, at least one data sequence, and identification information of the first code block to the code database via the network, and obtains the first identification information returned by the code database via the network. Alternatively, the first computing node uploads at least one sequence type and at least one data sequence of the first code block to the code database via the network, and obtains the first identification information returned by the code database via the network.

[0227] In some embodiments, after determining the first identification information of the first code block, the first computing node determines the submodule code according to the first identification information of the first code block and the at least one sequence type.

[0228] In some embodiments, the submodule code is a submodule code vector. The submodule code vector includes one element, which is the first identification information. Alternatively, the submodule code vector includes two elements, which are: the first identification information and a sequence type vector. The sequence type vector includes at least one element, each element being a sequence type.

[0229] Exemplarily, the first identification information is represented by an integer, such as a 32-bit or 64-bit unsigned integer. Alternatively, the first identification information is represented by a byte vector, where each byte in the first identification information is a vector formed as an element.

[0230] Exemplarily, the sequence type is represented by an integer, which is any one of the following: an 8-bit unsigned integer, a 16-bit unsigned integer, a 32-bit unsigned integer, or a 64-bit unsigned integer.

[0231] After determining the structure of the first submodule corresponding to the first code block, the first computing node determines at least one data sequence corresponding to the first code block or identification information of the at least one data sequence, thereby generating the first submodule. The first computing node executes the method of FIG. 7 for each code block in at least one original code file to generate at least one submodule, thereby generating a target executable file.

[0232] Optionally, the first computing node generates the accelerator function segment in the target execution file according to the encoding format of the accelerator function segment and according to the function or function declaration in the accelerator code block in at least one original code file.

[0233] Optionally, the first computing node generates the function segment in the target execution file according to the encoding format of the function segment and based on the function or function declaration in the accelerator code block in at least one original code file.

[0234] The method in the embodiment of the present application is according to the type of code block, determines the segment where the submodule after code block encoding is located in the target execution file, and according to compile instruction, determines the structure of the submodule corresponding to code block, thereby generates submodule, and indicates the coding format corresponding to the submodule by submodule option in the submodule. The method in the embodiment of the present application encodes at least one code block in a standardized manner, and then generates the target execution file. Because each submodule included in the target execution file is organized in a standardized form, therefore when executing the target execution file across platforms, the data sequence to be run in the target execution file can be determined relatively quickly, thereby running the data sequence, and then improving the execution efficiency of computing tasks.

[0235] Figure 8 is a schematic flow chart of a data processing method provided in an embodiment of the present application. The method in Figure 8 is executed by a second computing node, which can be any execution node in Figure 1. The second computing node and the first computing node can be the same or different computing nodes, and this embodiment of the present application is not limited to this. The method in Figure 8 includes the following steps.

[0236] S810, obtaining a target execution file.

[0237] The second computing node obtains a target execution file corresponding to at least one original code file. Each original code file includes at least one code block, and each code block includes at least one code statement. The embodiment of the present application does not limit the code language used to write the original code file, for example, C, C++, Rust, etc.

[0238] Exemplarily, the types of code blocks in the original code file include: accelerator code blocks, AI model code blocks, or host shared library code blocks. Accelerator code blocks are used to run on an accelerator. AI model code blocks are used for training or inference of AI models. Host shared library code blocks are used to assist in running accelerator code blocks and / or AI model code blocks. For a description of the host shared library code blocks, see the description in S210.

[0239] Illustratively, each code block may include a function, a method, a class, a package, an artificial neural network, etc.

[0240] The target executable file includes at least one segment, each segment including a segment identifier and at least one submodule. Each submodule corresponds to a code block. The code blocks corresponding to each submodule in a segment are of the same type. The segment identifier is used to indicate the type of code block corresponding to the segment. Each submodule includes a submodule option and a submodule code. The submodule option indicates the encoding format corresponding to the submodule code. The submodule code includes at least one data sequence or identification information corresponding to at least one data sequence. Each of the at least one data sequence is determined based on the encoding format indicated by the submodule option and the corresponding code block.

[0241] S820: Determine the to-be-executed data sequence corresponding to the submodule according to the segment identifier and the submodule option in the submodule.

[0242] After obtaining the target executable file, the second computing node determines the type of code block corresponding to each submodule in each segment based on the segment identifier in the target executable file. The second computing node determines the structure of the submodule code of the submodule based on the submodule options in the submodule, thereby determining the data sequence to be executed corresponding to each submodule.

[0243] Optionally, when the segment identifier of the first segment indicates that the first segment is an accelerator code segment, the first code block corresponding to the first submodule is an accelerator code block. The first segment is the segment where the first submodule is located. Similarly, when the segment identifier of the first segment is used to indicate that the first segment is an AI model code segment, the first code block corresponding to the first submodule is an AI model code block. When the segment identifier of the first segment is used to indicate that the first segment is a host shared library code segment, the first code block corresponding to the first submodule is a host shared library code block.

[0244] When the first segment is an accelerator code segment, the first submodule includes a submodule option and a submodule code. The submodule option includes the first option. Alternatively, the submodule option includes the first option and the second option. When the first segment is an AI model code segment, the first submodule includes a submodule option and a submodule code. The submodule option includes the first option. When the first segment is a host shared library code segment, the first submodule includes a submodule option and a submodule code. The submodule option includes the first option. The first option and the second option are described in FIG. 2 or FIG. 7 .

[0245] When the first option in the submodule options of the first submodule is a first-category option, the submodule code in the first submodule includes a data sequence. The data sequence is determined based on the encoding type indicated by the first-category option and the first code block. In other words, the data sequence is a data sequence corresponding to the first code block that conforms to the encoding type indicated by the first-category option.

[0246] When the first option in the submodule options of the first submodule is a first-category option, the second computing node determines whether it supports the encoding type indicated by the first-category option. When the second computing node supports the encoding type indicated by the first-category option, the second computing node determines that the data sequence in the submodule code is the data sequence to be executed corresponding to the first submodule. When the second computing node does not support the encoding type indicated by the first-category option, an alarm is issued.

[0247] Exemplarily, the issuing of the alarm includes: issuing an alarm message to the third computing node, where the alarm message is used to indicate that the encoding type supported by the second computing node does not match the encoding type of the data sequence in the target execution file.

[0248] Exemplarily, after the second computing node issues an alarm, the second computing node stops running the submodule or the target execution file.

[0249] When the first option in the submodule options of the first submodule is a second-category option, the submodule code in the first submodule includes at least one sequence type and a data sequence corresponding to each sequence type. The sequence type is used to indicate the encoding type corresponding to a data sequence, and the data sequence is determined based on the encoding type indicated by the corresponding sequence type and the first code block. In other words, the first data sequence is a data sequence corresponding to the first code block that conforms to the encoding type indicated by the first sequence type. The first sequence type belongs to the at least one sequence type, and the first data sequence corresponds to the first sequence type.

[0250] When the first option in the submodule options of the first submodule is a second-category option, the second computing node determines at least one sequence type included in the submodule code based on the encoding format indicated by the submodule option. The second computing node determines a preset sequence type and determines whether the preset sequence type is included in at least one sequence type included in the submodule code. In other words, the second computing node determines whether the preset sequence type is included in all sequence types included in the submodule code. When the preset sequence type is included in the submodule code, the second computing node determines that the data sequence corresponding to the preset sequence type is the data sequence to be run corresponding to the first submodule. When the preset sequence type is not included in the submodule code, the second computing node issues an alarm, or the second computing node redetermines the preset sequence type and repeats the above method.

[0251] Exemplarily, the preset sequence type is a sequence type supported by the second computing node, that is, the data sequence corresponding to the preset sequence type can be run in the second computing node.

[0252] When the second computing node supports running only one sequence type, the sequence type is a preset sequence type.

[0253] When the second computing node supports running N sequence types, the second computing node determines the first sequence type from the N sequence types as the preset sequence type. N is a positive integer greater than 1. The second computing node determines whether the preset sequence type is included in the submodule code of the first submodule. When the second computing node determines that the submodule code of the first submodule does not include the preset sequence type, the second computing node determines the nth sequence type from the N sequence types supported for running as the preset sequence type, and determines whether the preset sequence type is included in the submodule code of the first submodule. The nth sequence type is different from the first sequence type, n=2,...,N. If the submodule code of the first submodule does not include any sequence type supported for running by the second computing node, the second computing node issues an alarm.

[0254] When the first option in the submodule options of the first submodule is a third-category option, the submodule code in the first submodule includes first identification information. Alternatively, the submodule code in the first submodule includes the first identification information and at least one sequence type. The first identification information is used to indicate at least one data sequence corresponding to the first code block in the code database. The sequence type is used to indicate the encoding type corresponding to a data sequence. For a description of the code database, see FIG. 7 .

[0255] When the first option in the submodule options of the first submodule is a third-category option, the second computing node determines the first identification information in the submodule code according to the encoding format indicated by the submodule option. The second computing node determines the preset sequence type, and determines whether the at least one data sequence indicated by the first identification information includes a data sequence corresponding to the preset sequence type based on the first identification information and the preset sequence type. In other words, the second computing node determines whether all data sequences indicated by the first identification information include a data sequence corresponding to the preset sequence type. When the data sequence corresponding to the preset sequence type is included in all data sequences indicated by the first identification information, the second computing node determines that the data sequence corresponding to the preset sequence type is the data sequence to be run of the first submodule. When the data sequence corresponding to the preset sequence type is not included in all data sequences indicated by the first identification information, the second computing node issues an alarm, or the second computing node repeats the above method after re-determining the preset sequence type.

[0256] Exemplarily, the second computing node searches the local storage space to determine whether the local storage space stores at least one data sequence indicated by the first identification information. When at least one data sequence indicated by the first identification information is stored in the local storage space, the second computing node determines, based on the preset sequence type, whether all data sequences indicated by the first identification information include a data sequence corresponding to the preset sequence type. Alternatively, when at least one sequence type indicated by the first identification information and a data sequence corresponding to each sequence type are stored in the local storage space, the second computing node determines, based on the preset sequence type, whether all sequence types indicated by the first identification information include the preset sequence type. When the preset sequence type is included in all sequence types indicated by the first identification information, it is determined that the data sequence corresponding to the preset sequence type is the data sequence to be run corresponding to the first submodule.

[0257] When at least one data sequence indicated by the first identification information is not stored in the local storage space, the second computing node obtains a data sequence corresponding to the preset sequence type from the code database or issues an alarm based on the first identification information and the preset sequence type.

[0258] Exemplarily, the second computing node transmits the first identification information and the preset sequence type to a code database. If all sequence types indicated by the first identification information in the code database include the preset sequence type, the code database transmits the data sequence corresponding to the preset sequence type to the second computing node. If all sequence types indicated by the first identification information in the code database do not include the preset sequence type, the code database transmits first indication information to the second computing node. The first indication information indicates that the code database does not include the data sequence corresponding to the preset sequence type. After receiving the first indication information, the second computing node re-determines the preset sequence type and repeats the above method, or issues an alarm.

[0259] Exemplarily, the preset sequence type is a sequence type supported by the second computing node, that is, the data sequence corresponding to the preset sequence type can be run in the second computing node.

[0260] When the second computing node supports running only one sequence type, the sequence type is a preset sequence type.

[0261] When the second computing node supports running N sequence types, the second computing node determines the first sequence type from the N sequence types as the preset sequence type. N is a positive integer greater than 1. The second computing node determines whether all data sequences indicated by the first identification information include the data sequence corresponding to the preset sequence type. When the second computing node determines that all data sequences indicated by the first identification information do not include the data sequence corresponding to the preset sequence type, the second computing node determines the nth sequence type from the N sequence types supported for running as the preset sequence type, and determines whether all data sequences indicated by the first identification information include the data sequence corresponding to the preset sequence type. The nth sequence type is different from the first sequence type, n=2,...,N. If all data sequences indicated by the first identification information do not include the data sequence corresponding to any sequence type supported for running by the second computing node, the second computing node issues an alarm.

[0262] When the second computing node supports running multiple sequence types, the second computing node determines the preset sequence type according to the sequence type selection method. The embodiment of the present application does not limit the sequence type selection method. For example, the sequence type selection method includes: determining the preset sequence type according to the specified sequence type. The specified sequence type can be specified by any one of the following: operation and maintenance personnel, Wasm runtime, and a third computing node. The third node is a computing node connected to the second computing node, and an orchestration function module and / or a scheduling function module can be deployed in the third computing node. The orchestration function module or the scheduling function module is described in Figure 1. Alternatively, the sequence type selection method includes: according to the idleness of the accelerator in the second computing node, determining the sequence type corresponding to the idlest accelerator in the second computing node as the preset sequence type. Alternatively, the sequence type selection method includes: determining the preset sequence type according to the priority of each sequence type.

[0263] When the second computing node supports running multiple sequence types, the second computing node determines the order of arrangement of the multiple sequence types according to the sequence type sorting method, and determines the preset sequence types in sequence according to the order of arrangement. The embodiment of the present application does not limit the sequence type sorting method. For example, the sequence type sorting method includes: sorting in a specified order, sorting the sequence types corresponding to the accelerators according to the idleness of the accelerators in the second computing node, sorting according to the priority of the sequence types, etc.

[0264] Optionally, before S820 , the second computing node may sense the encoding type or sequence type supported by the second computing node.

[0265] S830, executing the sequence to be executed corresponding to the submodule.

[0266] After determining the to-be-executed data sequence corresponding to the first submodule, the second computing node parses and executes the to-be-executed data sequence corresponding to the first submodule.

[0267] When the first code block corresponding to the first submodule is an accelerator code block, the second computing node determines whether the data sequence to be run corresponding to the first submodule needs to be translated based on the second option in the submodule options of the first submodule. Specifically, the second computing node determines that the data sequence to be run corresponding to the first submodule is an intermediate representation code based on the second option in the submodule options of the first submodule. The second computing node translates the data sequence to be run into a device-related code of the accelerator in the second computing node. The accelerator is, for example, an independent accelerator or an accelerator engine built into a processor. The second computing node runs the device-related code corresponding to the data sequence to be run through the accelerator in the second computing node.

[0268] Exemplarily, the second computing node translates the data sequence to be run through a translation plug-in. For example, when the target executable file is a Wasm module, the Wasm runtime in the second computing node transmits the data sequence to be run to a built-in or external translation plug-in of the Wasm runtime. The translation plug-in translates the data sequence to be run into the device-related code of the accelerator in the second computing node, and returns the device-related code corresponding to the data sequence to be run to the Wasm runtime. The Wasm runtime transmits the device-related code corresponding to the data sequence to be run to the accelerator runtime (accelerator runtime), and the accelerator runtime runs the device-related code corresponding to the data sequence to be run through the accelerator.

[0269] Exemplarily, the second computing node translates the data sequence to be executed through the accelerator runtime. For example, when the target executable file is a Wasm module, the Wasm runtime in the second computing node transmits the data sequence to be executed to the accelerator runtime in the second computing node. The accelerator runtime transfers the data sequence to be executed into device-dependent code for the accelerator in the second computing node, and executes the device-dependent code corresponding to the data sequence to be executed through the accelerator.

[0270] When the second computing node determines that the data sequence to be executed corresponding to the first submodule is a device-related code, the second computing node executes the data sequence to be executed through an accelerator in the second computing node.

[0271] Optionally, the second computing node may preload the target executable file. For example, the second computing node determines the structure of each segment based on the segment identifier in the target executable file. The second computing node traverses each submodule in each segment and, based on the submodule options in each submodule, determines the structure of the submodule code within the submodule. If the submodule is in the ready state, the second computing node determines the corresponding data sequence to be executed for the submodule based on the structure of the submodule code within the submodule.

[0272] Optionally, the second computing node can load the target execution file on demand. For example, when the second computing node needs to call any one of the accelerator code block, AI model code block, or host shared library code block when running the code segment in the target execution file, the second computing node determines the corresponding segment based on the segment identifier in the target execution file. The second computing node determines the submodule to be called in the segment based on the structure of the segment indicated by the segment identifier, and determines the data sequence to be run corresponding to the submodule based on the submodule option in the submodule, thereby running the data sequence to be run.

[0273] Optionally, before S810, each of the at least one computing node may send second indication information to a third computing node. The second indication information is used to indicate at least one encoding type or at least one sequence type supported by each computing node. The third computing node is deployed with an orchestration function module and / or a scheduling function module. The orchestration function module or the scheduling function module is described in FIG1 . The at least one computing node includes a second computing node.

[0274] In some embodiments, the third computing node obtains a target execution file and determines the encoding type or sequence type corresponding to the data sequence in each submodule in the target execution file. The third computing node determines a computing node or a computing node list for executing each submodule based on the encoding type or sequence type corresponding to the data sequence in each submodule and the encoding types or sequence types supported by each computing node.

[0275] The method in the embodiments of the present application encodes at least one code block in a standardized manner to generate a target executable file. Because each submodule included in the target executable file is organized in a standardized form, when executing the target executable file across platforms, the data sequence to be executed in the target executable file can be determined relatively quickly, thereby executing the data sequence, thereby improving the execution efficiency of the computing task.

[0276] Alternatively, the text format of the accelerator code can be expressed as:

[0277] acccode::='(''acccode'id codetype codeoption accfunccode')'

[0278] Among them, acccode is a keyword used to indicate that the subsequent "id codetype codeoption accfunccode" belongs to a submodule corresponding to an accelerator code block. It should be understood that acccode is only an exemplary illustration, and the embodiment of the present application does not limit the specific name of the keyword. ID is the identification information of the accelerator code block, such as the function name. Exemplarily, ID is represented by the character "$" plus the function name (such as add), that is, ID is represented as $add. Codetype is the second option in the submodule option, expressed as a string. Codeoption is the first option in the submodule option, expressed as a string. Accfunccode is the submodule code. The embodiment of the present application does not limit the specific value-taking method of codetype and codeoption. For example, it may include at least one character, and the at least one character includes: text, numbers, letters, symbols, etc.

[0279] In some embodiments, codetype is not included in the accelerator code.

[0280] When the first option in the submodule options of the first submodule is a first-category option, the submodule code in the accelerator code can be expressed as: accfunccode::='(''accfunccode'funccodes')'. Wherein, accfunccode is a keyword used to indicate that the subsequent "funccodes" content is the submodule code corresponding to the accelerator code block. It should be understood that accfunccode is only an example, and the embodiments of the present application do not limit the specific name of the keyword. funccodes is a data sequence represented as a string.

[0281] When the first option in the submodule options of the first submodule is a second-category option, the submodule code in the accelerator code can be expressed as: accfunccode::='(''accfunccode'accfuncinsts')'. Accfunccode is a keyword used to indicate that the subsequent "accfuncinsts" belongs to the submodule code corresponding to the accelerator code block. It should be understood that accfunccode is only an example, and the embodiments of the present application do not limit the specific name of the keyword. Accfuncinsts is a submodule code vector, including at least one element.

[0282] Each element in the submodule code vector can be expressed as: accfuncinst::='(''accfuncinst'targettype funccodes')'. Among them, accfuncinst is a keyword used to indicate that the subsequent "targettype funccodes" belongs to an element in the submodule code corresponding to the accelerator code block. It should be understood that accfuncinst is only an example, and the embodiments of this application do not limit the specific name of the keyword. targettype is a sequence type, represented as a string or a number. funccodes is a data sequence, represented as a string.

[0283] When the first option in the submodule options of the first submodule is a third-category option, the submodule code in the accelerator code can be expressed as: accfunccode::='(''accfunccode'functionid')'. Alternatively, the submodule code in the accelerator code can be expressed as: accfunccode::='(''accfunccode'functionid targettypes')'. Among them, accfunccode is a keyword used to indicate that the subsequent "functionid" or "functionid targettypes" belongs to the submodule code corresponding to the accelerator code block. It should be understood that accfunccode is only an example, and the embodiments of the present application do not limit the specific name of the keyword. functionid is the first identification information, expressed as an integer or a string. targettypes is a sequence type vector, including at least one element, each element is a sequence type. The sequence type is expressed as a string or a number.

[0284] Optionally, the text format of the AI ​​model code can be expressed as:

[0285] model::='(''model'modelname modeloption modelcontent')'

[0286] Among them, model is a keyword used to indicate that the subsequent "modelname modeloption modelcontent" belongs to a submodule corresponding to an AI model code block. It should be understood that model is only an exemplary illustration, and the embodiments of the present application do not limit the specific name of the keyword. Modelname is the identification information of the AI ​​model code block, such as the model name. Modelname is expressed as a string, generally a string encoded in 8-bit Unicode transformation format (8bits, UTF-8). Modeloption is the first option in the submodule option, expressed as a string. Modelcontent is the submodule code.

[0287] In some embodiments, modelname is not included in the AI ​​model code.

[0288] When the first option in the submodule options of the first submodule is a second-category option, the submodule code in the AI ​​model code can be expressed as: modelcontent::='(''modelcontent'modelparaminsts')'. Wherein, modelcontent is a keyword used to indicate that the subsequent "modelparaminsts" belongs to the submodule code corresponding to the AI ​​model code block. It should be understood that modelcontent is only an exemplary illustration, and the embodiment of the present application does not limit the specific name of the keyword. modelparaminsts is a submodule code vector, including at least one element. Each element in the submodule code vector can be expressed as: modelparaminst::='(''modelparaminst'modelformat modelparams')'. Wherein, modelparaminst is a keyword used to indicate that the subsequent "modelformat modelparams" belongs to an element in the submodule code corresponding to the AI ​​model code block. It should be understood that modelparaminst is only an exemplary illustration, and the embodiment of the present application does not limit the specific name of the keyword. modelformat is a sequence type, represented as a string or a number. modelparams is a data sequence, represented as a string.

[0289] When the first option in the submodule options of the first submodule is a third-category option, the submodule code in the AI ​​model code can be expressed as: modelcontent::='(''modelcontent'modelid')'. Alternatively, the submodule code in the AI ​​model code can be expressed as: modelcontent::='(''modelcontent'modelid modelformats')'. Among them, modelcontent is a keyword used to indicate that the subsequent "modelid" or "modelid modelformats" belongs to the submodule code corresponding to the AI ​​model code block. It should be understood that modelcontent is only an exemplary illustration, and the embodiments of the present application do not limit the specific name of the keyword. modelid is the first identification information, expressed as an integer or a string. modelformats is a sequence type vector, including at least one element, each element is a sequence type. The sequence type is represented as a string or a number.

[0290] Alternatively, the text format of the host shared library code can be represented as:

[0291] hostsharedcode::='(''hostsharedcode'hostshlibname hostshliboption hostshlibcontent')'

[0292] Among them, hostsharedcode is a keyword used to indicate that the subsequent "hostshlibname hostshliboption hostshlibcontent" belongs to a submodule corresponding to a host shared library code block. It should be understood that hostsharedcode is only an exemplary description, and the embodiments of this application do not limit the specific name of this keyword. hostshlibname is the identification information of the host shared library code block, for example, the host shared library name. hostshlibname is represented as a string, generally a UTF-8 encoded string. hostshliboption is the first option in the submodule option, represented as a string. hostshlibcontent is the submodule code.

[0293] In some embodiments, hostshlibname is not included in the host shared library code.

[0294] When the first option in the submodule options of the first submodule is a second-category option, the submodule code in the host shared library code can be expressed as: hostshlibcontent::='(''hostshlibcontent'hostshlibinsts')'. Wherein, hostshlibcontent is a keyword used to indicate that the subsequent "hostshlibinsts" belongs to the submodule code corresponding to the host shared library code block. It should be understood that hostshlibcontent is only an exemplary illustration, and the embodiment of the present application does not limit the specific name of the keyword. hostshlibinsts is a submodule code vector, including at least one element. Each element in the submodule code vector can be expressed as: hostshlibinst::='(''hostshlibinst'targettype hostshlibs')'. Wherein, hostshlibinst is a keyword used to indicate that the subsequent "targettype hostshlibs" belongs to an element in the submodule code corresponding to the host shared library code block. It should be understood that hostshlibinst is only an exemplary illustration, and the embodiment of the present application does not limit the specific name of the keyword. targettype is a sequence type, represented as a string or a number. hostshlibs is a data sequence represented as a string.

[0295] When the first option in the submodule options of the first submodule is a third-category option, the submodule code in the host shared library code can be expressed as: hostshlibcontent::='(''hostshlibcontent'hostshlibid')'. Alternatively, the submodule code in the host shared library code can be expressed as: hostshlibcontent::='(''hostshlibcontent'hostshlibid targettypes')'. Among them, hostshlibcontent is a keyword used to indicate that the subsequent "hostshlibid" or "hostshlibid targettypes" belongs to the submodule code corresponding to the host shared library code block. It should be understood that hostshlibcontent is only an exemplary explanation, and the embodiments of the present application do not limit the specific name of the keyword. hostshlibid is the first identification information, expressed as an integer or a string. targettypes is a sequence type vector, including at least one element, each element is a sequence type. The sequence type is expressed as a string or a number.

[0296] Figure 9 is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Data processing device 900 in Figure 9 includes an acquisition module 910 and a processing module 920. Data processing device 900 in Figure 9 can be used to execute the method of Figure 2, Figure 7, or Figure 8. Data processing device 900 in Figure 9 can be applied to a computing node, such as any computing node in Figure 1.

[0297] When data processing device 900 is used to execute the method in FIG. 2 , acquisition module 910 is used to obtain at least one original code file and execute S210 in FIG. Processing module 920 is used to determine the encoding format corresponding to each code block based on at least one compilation instruction. Processing module 920 is also used to compile the at least one code block into a target executable file based on the encoding format corresponding to each code block in the at least one code block. Processing module 920 is used to execute S220 and S230 in FIG. 2 .

[0298] When the data processing device 900 is used to execute the method in FIG. 7 , the processing module 920 is used to execute S710 to S750 in FIG. 7 .

[0299] When data processing device 900 is used to execute the method in FIG8 , acquisition module 910 is used to obtain a target executable file and execute S810 in FIG8 . Processing module 920 is used to determine the data sequence to be executed corresponding to the submodule based on the segment identifier and the submodule option in the submodule. Processing module 920 is also used to execute the data sequence to be executed corresponding to the submodule. Processing module 920 is used to execute S820 and S830 in FIG8 .

[0300] The acquisition module 910 and the processing module 920 can be implemented by software or hardware. For example, the implementation of the processing module 920 will be described below using the processing module 920 as an example. Similarly, the implementation of the acquisition module 910 can refer to the implementation of the processing module 920.

[0301] As an example of a software functional unit, the processing module 920 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing module 920 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0302] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same VPC or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0303] As an example of a hardware functional unit, processing module 920 may include at least one computing device, such as a server. Alternatively, processing module 920 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0304] The multiple computing devices included in processing module 920 can be distributed in the same region or in different regions. The multiple computing devices included in processing module 920 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in processing module 920 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0305] Therefore, the modules of each example described in the embodiments of this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0306] It should be noted that: when the device provided in the above embodiment executes the above method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. For example, the acquisition module 910 can be used to execute any step in the above method, and the processing module 920 can be used to execute any step in the above method. The steps that the acquisition module 910 and the processing module 920 are responsible for implementing can be specified as needed, and all the functions of the above device can be realized by respectively implementing different steps in the above method through the acquisition module 910 and the processing module 920.

[0307] In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation processes are detailed in the method embodiments above and will not be repeated here.

[0308] The method provided in the embodiment of the present application can be performed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a processing unit, a memory and a memory control unit, and the function and structure of the hardware are subsequently described in detail. The operating system is any one or more computer operating systems that implement business processing through a process, for example, a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system or a Windows operating system. The application layer includes applications such as a browser, an address book, a word processing software, and an instant messaging software. Furthermore, optionally, the computer system is a handheld device such as a smart phone, or a terminal device such as a personal computer, and this application is not particularly limited, as long as the method provided in the embodiment of the present application can be used. The execution subject of the method provided in the embodiment of the present application can be a computing device, or a functional module in a computing device that can call a program and execute a program.

[0309] FIG10 is a schematic block diagram of a computing device 1000 provided in an embodiment of the present application. The computing device 1000 may be a server, a computer, or other device with computing capabilities. The computing device 1000 shown in FIG10 includes at least one processor 1010 and a memory 1020.

[0310] It should be understood that this application does not limit the number of processors and memories in the computing device 1000.

[0311] The processor 1010 executes the instructions in the memory 1020 so that the computing device 1000 implements the method provided in this application. Alternatively, the processor 1010 executes the instructions in the memory 1020 so that the computing device 1000 implements the functional modules provided in this application, thereby implementing the method provided in this application.

[0312] Optionally, the computing device 1000 further includes a communication interface 1030. The communication interface 1030 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1000 and other devices or a communication network.

[0313] Optionally, the computing device 1000 further includes a system bus 1040, wherein the processor 1010, the memory 1020, and the communication interface 1030 are respectively connected to the system bus 1040. The processor 1010 can access the memory 1020 through the system bus 1040. For example, the processor 1010 can read and write data or execute code in the memory 1020 through the system bus 1040. The system bus 1040 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus 1040 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in Figure 10, but it does not mean that there is only one bus or one type of bus.

[0314] In one possible implementation, the processor 1010 is primarily responsible for interpreting computer program instructions (or codes) and processing data in the computer software. The computer program instructions and the data in the computer software may be stored in the memory 1020 or the cache of the processor 1010.

[0315] Optionally, processor 1010 may be an integrated circuit chip with signal processing capabilities. By way of example and not limitation, processor 1010 is a general-purpose processor, a digital signal processor (DSP), an ASIC, an FPGA, or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component. A general-purpose processor is a microprocessor, for example. For example, processor 1010 is a central processing unit (CPU).

[0316] Memory 1020 can provide runtime space for processes in computing device 1000. For example, memory 1020 stores computer programs (specifically, program code) used to generate processes. After the computer program is executed by the processor to generate a process, the processor allocates corresponding storage space for the process in memory 1020. Furthermore, the aforementioned storage space further includes a text segment, an initialized data segment, a bit-initialized data segment, a stack segment, a heap segment, and the like. Memory 1020 stores data generated during the execution of the process, such as intermediate data or process data, in the storage space corresponding to the aforementioned process.

[0317] Alternatively, the memory is also referred to as the internal memory. It is used to temporarily store data being processed by the processor 1010, as well as data exchanged with external storage devices such as a hard disk. As long as the computer is running, the processor 1010 will load the data to be processed into the internal memory for processing, and then transmit the result after the calculation is completed.

[0318] By way of example and not limitation, memory 1020 is a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile storage medium may be, for example, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory is a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus DRAM (DRDRAM). It should be noted that the memory 1020 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0319] The structure of the computing device 1000 listed above is only an example description, and the present application is not limited thereto. The computing device 1000 of the embodiment of the present application includes various hardware in the computer system in the prior art. For example, the computing device 1000 also includes other memories in addition to the memory 1020, such as disk storage, etc. It should be understood by those skilled in the art that the computing device 1000 may also include other devices necessary to achieve normal operation. At the same time, according to specific needs, it should be understood by those skilled in the art that the computing device 1000 may also include hardware devices that implement other additional functions. In addition, it should be understood by those skilled in the art that the computing device 1000 may also include only the devices necessary to implement the embodiment of the present application, and does not necessarily include all the devices shown in Figure 10.

[0320] The present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0321] As shown in Figure 11, the computing device cluster includes at least one computing device 1000. The memory 1020 in one or more computing devices 1000 in the computing device cluster may store the same instructions for executing the above method.

[0322] In some possible implementations, the memory 1020 of one or more computing devices 1000 in the computing device cluster may also store some instructions for executing the above method. In other words, the combination of one or more computing devices 1000 can jointly execute the instructions of the above method.

[0323] It should be noted that the memory 1020 in different computing devices 1000 in the computing device cluster can store different instructions, each for performing part of the functions of the above-mentioned apparatus. In other words, the instructions stored in the memory 1020 in different computing devices 1000 can implement the functions of one or more modules in the above-mentioned apparatus.

[0324] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. The network can be a wide area network (WAN), a local area network (LAN), or the like. FIG12 illustrates one possible implementation. As shown in FIG12 , two computing devices 1000A and 1000B are connected via a network. Specifically, each computing device is connected to the network via a communication interface within the computing device.

[0325] It should be understood that the functionality of the computing device 1000A shown in FIG12 may also be accomplished by multiple computing devices 1000. Similarly, the functionality of the computing device 1000B may also be accomplished by multiple computing devices 1000.

[0326] In an embodiment of the present application, a data processing system is further provided. The data processing system includes the first computing node and the second computing node in the embodiment of the application described above. Alternatively, the data processing system includes the first computing node, the second computing node, and the third computing node in the embodiment of the application described above.

[0327] In an embodiment of the present application, a computer program product including instructions is also provided. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on a computing device, the computer program product causes the computing device to perform the method provided above, or causes the computing device to implement the functions of the apparatus provided above.

[0328] In an embodiment of the present application, a computer program product including instructions is also provided. The computer program product may be software or a program product including instructions that can be run on a computing device cluster or stored in any available medium. When executed by a computing device cluster, the computer program product causes the computing device cluster to perform the method provided above, or causes the computing device cluster to implement the functions of the apparatus provided above.

[0329] In an embodiment of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that, when executed on a computing device, cause the computing device to perform the method provided above.

[0330] In an embodiment of the present application, a computer-readable storage medium is also provided. The computer-readable storage medium can be any available medium capable of storing data on a computing device, or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that, when executed by a computing device cluster, cause the computing device cluster to perform the method provided above.

[0331] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0332] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0333] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0334] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0335] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0336] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0337] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A data processing method, characterized in that: include: Obtain at least one original code file, wherein the original code file includes at least one code block, and each code block includes at least one code statement; Determining, according to at least one compilation instruction, a coding format corresponding to each code block, where the coding format corresponding to the code block is used to indicate a structure after encoding the code block; According to the encoding format corresponding to each code block in the at least one code block, the at least one code block is compiled into a target execution file, the target execution file includes at least one segment, each segment includes a segment identifier and at least one sub-module, each sub-module corresponds to a code block, the code blocks corresponding to each sub-module in the segment are of the same type, the segment identifier is used to indicate the type of the code block corresponding to the segment, each sub-module includes a sub-module option and a sub-module code, the sub-module option is used to indicate the encoding format corresponding to the sub-module code, the sub-module code includes at least one data sequence or identification information corresponding to the at least one data sequence, and each data sequence in the at least one data sequence is determined according to the encoding format indicated by the sub-module option and the corresponding code block.

2. The method according to claim 1, characterized in that The compilation instruction corresponding to the first code block includes a first parameter, the sub-module option in the sub-module corresponding to the first code block includes a first option, the first option is the same as the first parameter, and the first code block belongs to the at least one code block.

3. The method according to claim 1 or 2, characterized in that When the submodule options include first-category options, the submodule code includes a data sequence, and the data sequence in the submodule code is determined according to the encoding type indicated by the first-category options and the corresponding code block.

4. The method according to claim 1 or 2, characterized in that When the sub-module option includes the second type of option, the sub-module code includes at least one sequence type and a data sequence corresponding to each sequence type, the sequence type is used to indicate the encoding type corresponding to a data sequence, and the data sequence is determined according to the encoding type indicated by the sequence type and the corresponding code block.

5. The method according to claim 1 or 2, characterized in that When the sub-module option includes the third category option, the sub-module code includes first identification information, or the sub-module code includes first identification information and at least one sequence type, the first identification information is used to indicate at least one data sequence corresponding to the code block corresponding to the sub-module in the code database, and the sequence type is used to indicate the encoding type corresponding to a data sequence.

6. The method according to claim 5, characterized in that The method further comprises: determining, according to the at least one sequence type, at least one data sequence corresponding to the first code block, each data sequence corresponding to a sequence type, and the first code block belonging to the at least one code block; The at least one sequence type and at least one data sequence corresponding to the first code block are transmitted to the code database to obtain first identification information of a submodule corresponding to the first code block.

7. The method according to any one of claims 4 to 6, characterized in that The method is executed by a first computing node, and each sequence type in the at least one sequence type is a sequence type supported by the first computing node for generation.

8. The method according to any one of claims 1 to 7, characterized in that When the first code block is an accelerator code block, the sub-module option in the first sub-module corresponding to the first code block also includes a second option, the first code block belongs to the at least one code block, and the second option is used to indicate that the sub-module code in the first sub-module is an intermediate representation code or a device-related code. When the sub-module code in the first sub-module is an intermediate representation code, the sub-module code is run by the accelerator after being translated into device-related code.

9. The method according to claim 8, characterized in that The compilation instruction corresponding to the first code block also includes a second parameter, and the second parameter is the same as the second option.

10. The method according to any one of claims 1 to 9, characterized in that When the at least one code block includes one or more accelerator code blocks, the target execution file also includes an accelerator function segment, and the accelerator function segment is used to declare functions corresponding to the one or more accelerator code blocks.

11. A data processing method, characterized in that: include: Obtain a target execution file, the target execution file corresponds to at least one original code file, the original code file includes at least one code block, each code block includes at least one code statement, the target execution file includes at least one segment, each segment includes a segment identifier and at least one submodule, each submodule corresponds to a code block, the code blocks corresponding to each submodule in the segment are of the same type, the segment identifier is used to indicate the type of the code block corresponding to the segment, each submodule includes a submodule option and a submodule code, The submodule option is used to indicate the encoding format corresponding to the submodule code, the submodule code includes at least one data sequence or identification information corresponding to the at least one data sequence, and each data sequence in the at least one data sequence is determined according to the encoding format indicated by the submodule option and the corresponding code block; determining, according to the segment identifier and the submodule option in the submodule, a data sequence to be run corresponding to the submodule, wherein the data sequence to be run belongs to the at least one data sequence; Run the data sequence to be run corresponding to the submodule.

12. The method according to claim 11, characterized in that When the sub-module options include first-category options, the sub-module code includes a data sequence, the data sequence in the sub-module code is determined according to the encoding type indicated by the first-category options and the corresponding code block, and the data sequence in the sub-module code is the data sequence to be run.

13. The method according to claim 11, characterized in that When the sub-module option includes the second type of option, the sub-module code includes at least one sequence type and a data sequence corresponding to each sequence type, the sequence type is used to indicate the encoding type corresponding to a data sequence, and the data sequence is determined according to the encoding type indicated by the sequence type and the corresponding code block.

14. The method according to claim 13, characterized in that When the submodule options include the second type of options, determining the to-be-executed data sequence corresponding to the submodule according to the segment identifier and the submodule options in the submodule includes: determining, based on the segment identifier and an encoding format indicated by a submodule option in the submodule, the at least one sequence type included in the submodule code; When the at least one sequence type includes a preset sequence type, determining a data sequence corresponding to the preset sequence type as the data sequence to be executed; When the preset sequence type is not included in the at least one sequence type, an alarm is sent.

15. The method according to claim 11, characterized in that When the sub-module option includes the third category option, the sub-module code includes first identification information, or the sub-module code includes first identification information and at least one sequence type, the first identification information is used to indicate at least one data sequence corresponding to the code block corresponding to the sub-module in the code database, and the sequence type is used to indicate the encoding type corresponding to a data sequence.

16. The method according to claim 15, characterized in that When the submodule options include the third type of options, determining the to-be-executed data sequence corresponding to the submodule according to the segment identifier and the submodule options in the submodule includes: determining the first identification information according to the segment identifier and the encoding format indicated by the submodule option in the submodule; When the at least one data sequence indicated by the first identification information includes a data sequence corresponding to a preset sequence type, determining the data sequence corresponding to the preset sequence type as the data sequence to be executed; When the at least one data sequence indicated by the first identification information does not include a data sequence corresponding to the preset sequence type, an alarm is sent.

17. The method according to claim 15 or 16, characterized in that When the submodule options include the third category options, the method further includes: When at least one data sequence corresponding to the first identification information is stored in a local storage space, obtaining, from the local storage space according to the first identification information, at least one data sequence corresponding to the first identification information; When at least one data sequence corresponding to the first identification information is not stored in the local storage space, the data sequence corresponding to the first identification information and the preset sequence type is obtained from the code database according to the preset sequence type and the first identification information, or an alarm is sent.

18. The method according to any one of claims 14 to 17, characterized in that The method is executed by a second computing node, and the preset sequence type is a sequence type supported by the second computing node.

19. The method according to any one of claims 11 to 18, characterized in that When the first code block is an accelerator code block, the sub-module option in the first sub-module corresponding to the first code block also includes a second option, the first code block belongs to the at least one code block, and the second option is used to indicate that the sub-module code in the first sub-module is an intermediate representation code or a device-related code. When the sub-module code in the first sub-module is an intermediate representation code, the data sequence to be run is translated into a device-related code, and the device-related code corresponding to the data sequence to be run is run in the accelerator. When the sub-module code in the first sub-module is a device-related code, the data sequence to be run is run in the accelerator.

20. The method according to any one of claims 1 to 19, characterized in that The types of code blocks include: accelerator code blocks, AI model code blocks or host shared library code blocks. The accelerator code blocks are used to run on the accelerator, the AI ​​model code blocks are used for training or reasoning of AI models, and the host shared library code blocks are used to assist in running the accelerator code blocks and / or AI model code blocks.

21. A data processing device, characterized in that: The device comprises a processor configured to execute instructions stored in a memory, so that the data processing device is configured to perform the method according to any one of claims 1 to 20.

22. The data processing device according to claim 21, characterized in that The data processing apparatus includes at least one computing device, each computing device including a processor; The processor of the at least one computing device is configured to execute instructions stored in the memory, so that the data processing apparatus performs the method according to any one of claims 1 to 20.

23. A chip system, characterized in that: include: A logic circuit, the logic circuit being configured to be coupled to an input / output interface and to transmit data via the input / output interface so as to execute the method according to any one of claims 1 to 20.

24. A computer-readable storage medium, characterized in that The method comprises computer program instructions which, when executed by a data processing device, cause the data processing device to perform the method according to any one of claims 1 to 20.

25. A computer program product comprising instructions, characterized in that When the instructions are executed by a data processing device, the data processing device is caused to perform the method according to any one of claims 1 to 20.

Citation Information

Patent Citations

  • Data processing method and related equipment

    CN120540655A

  • Code conversion method and device

    CN111209004A

  • Code translation method, device and equipment

    CN114327492A

  • Code block translation method and device, electronic equipment and storage medium

    CN116400927A

  • Techniques for natively interpreting logic across disparate platforms

    US11847477B1