Transfer file mapping method and device, electronic equipment and storage medium

By parsing and combining code files from different manufacturers, a unified second code file is generated, which solves the problem of adaptation overhead in diverse heterogeneous computing power scenarios, and enables cross-architecture transfer and program compilation of the same application on different hardware devices. Unified formatting of code.

CN118796265APending Publication Date: 2024-10-18CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410007886.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-02
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In diverse heterogeneous computing power scenarios, deploying the same application on different hardware devices requires developers to manually adapt multiple binary files, resulting in a waste of resources and increased costs.

Method used

By obtaining multiple code files from different manufacturers, parsing and combining them to generate a unified second code file, including file headers, transfer file descriptors, code package descriptors and attribute sets, and send the files to different manufacturers so that they can Flow and execute across architectures.

Benefits of technology

It realizes cross-architecture transfer of the same application between different computing architectures, reduces adaptation overhead, and improves the efficiency of unified formatting of compiler code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796265A_ABST
    Figure CN118796265A_ABST
Patent Text Reader

Abstract

The invention discloses a circulation file mapping method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a plurality of first code files corresponding to different manufacturers; respectively analyzing the plurality of first code files to obtain first information of a first file header segment and second information of a program header segment in each first code file; performing combination processing on the first information and the second information to generate a plurality of second code files corresponding to the first code files; sending the second code file to the different manufacturers; the second code file is used for each manufacturer in the different manufacturers to obtain and execute the required compiling program code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical fields of cloud computing, heterogeneous code mapping and code packaging, and in particular to a mapping method, device, electronic device and storage medium for flow files. Background Art

[0002] For diverse heterogeneous computing power, it is cumbersome to deploy the same application on different hardware devices in mixed heterogeneous scenarios. Developers must generate multiple binary files for the same application and manually adapt to different hardware manufacturers, wasting resources and increasing costs. Summary of the invention

[0003] To solve the related technical problems, the embodiments of the present application provide a mapping method, device, electronic device and storage medium for streaming files.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a method for mapping a flow file, including:

[0006] Obtain multiple first code files corresponding to different manufacturers;

[0007] Parse the plurality of first code files respectively to obtain first information of a first file header segment and second information of a program header segment in each of the first code files;

[0008] Combining the first information and the second information to generate a second code file corresponding to the plurality of the first code files;

[0009] The second code file is sent to the different manufacturers; the second code file is used for each of the different manufacturers to obtain the required compiler code and execute it.

[0010] In the above solution, the second code file includes a second file header segment, a flow file descriptor, a code package descriptor and an attribute set, and the first information and the second information are combined and processed to generate a second code file corresponding to the plurality of the first code files, including:

[0011] The first information is mapped to the second file header segment and the flow file descriptor, and the second information is mapped to the code package descriptor and the attribute set to obtain the second code file.

[0012] In the above solution, the first code file includes policy information; the second code file includes code package descriptors of each manufacturer; and the method further includes:

[0013] Mapping the policy information to the data segment of the streaming file descriptor, and generating first position information of the policy information in the streaming file descriptor;

[0014] The first location information is mapped to the code package descriptor.

[0015] In the above solution, the first information includes information on whether the file is executable, target operating system information, link type information, and target hardware information in the first file header segment; and mapping the first information to the second file header segment and the flow file descriptor includes:

[0016] Mapping the information on whether the file is executable, the target operating system information, and the link type information to the second file header segment;

[0017] The target hardware information is mapped to the flow file descriptor.

[0018] In the above solution, the first information includes the location information of the carried program code; the second code file also includes the program code segment and the code package descriptors of each manufacturer; the method also includes:

[0019] determining the program codes of the respective manufacturers based on the location information;

[0020] Mapping the program code to the program code segment and generating second position information of the program code in the program code segment;

[0021] The second location information is mapped to the code package descriptor.

[0022] In the above solution, the first information includes the third location information of the descriptor of each of the different manufacturers and the fourth location information of the user policy; the method further includes:

[0023] The third position information and the fourth position information are mapped into the streaming file descriptor.

[0024] In the above scheme, the method further comprises:

[0025] Determine third information of the memory size of the second code file, fifth position information of the flow file descriptor, and fourth information of the memory size of the second file header segment;

[0026] The third information, the fifth position information, and the fourth information are mapped into the second file header segment.

[0027] The present application also provides a mapping device for a flow file, including:

[0028] An acquisition unit, used to acquire a plurality of first code files corresponding to different manufacturers;

[0029] A parsing unit, used for parsing the plurality of first code files respectively, to obtain first information of a first file header segment and second information of a program header segment in each of the first code files;

[0030] a processing unit, configured to combine and process the first information and the second information to generate a second code file corresponding to the plurality of the first code files;

[0031] The sending unit is used to send the second code file to the different manufacturers; the second code file is used for each of the different manufacturers to obtain the required compiler code and execute it.

[0032] The present application also provides an electronic device, including:

[0033] A memory for storing executable instructions;

[0034] The processor is used to implement any step of the above-mentioned method when executing the executable instructions stored in the memory.

[0035] The embodiment of the present application also provides a computer-readable storage medium storing executable instructions for implementing any step of the above-described method when executed by a processor.

[0036] The mapping method, device, electronic device and storage medium of the flow file provided by the embodiment of the present application, wherein the method comprises: obtaining multiple first code files corresponding to different manufacturers; parsing the multiple first code files respectively to obtain the first information of the first file header segment and the second information of the program header segment in each of the first code files; combining the first information and the second information to generate a second code file corresponding to the multiple first code files; sending the second code file to the different manufacturers; the second code file is used for each of the different manufacturers to obtain the required compiler code and execute it. The scheme of the embodiment of the present application, by parsing the multiple first code files corresponding to different manufacturers respectively, obtains the first information of the first file header segment and the second information of the program header segment in each of the first code files; combining the first information and the second information to generate a second code file corresponding to the multiple first code files; sending the second code file for each of the different manufacturers to obtain the required compiler code and execute it to different manufacturers; that is, the compiler code of different manufacturers is changed from being carried by multiple files to being carried by one file in a unified format, thereby realizing the cross-architecture flow of the same file between different computing architectures and reducing the adaptation overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a schematic diagram showing that binary files output by different manufacturers are currently incompatible with each other;

[0038] Figure 2 A schematic diagram of a mapping method flow for a flow file is provided for an embodiment of the present application;

[0039] Figure 3 A schematic diagram of mapping a unified binary transferable file for an embodiment of the present application;

[0040] Figure 4 A schematic diagram of mapping compiled codes of different manufacturers to a unified flow file in an embodiment of the present application;

[0041] Figure 5 A schematic diagram of the process of mapping compiled codes of different manufacturers to a unified flow file in an embodiment of the present application;

[0042] Figure 6 This is a schematic diagram of the structure of a mapping device for circulating files according to an embodiment of the present application;

[0043] Figure 7 A schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0045] Entering the era of intelligent everything, the explosive growth of massive data and the diversification of application scenarios have driven the rapid development of emerging technologies and accelerated the diversified development of computing power. While the performance of general-purpose chips such as CPUs and GPUs continues to upgrade, the development of computing chips is still continuing, and heterogeneous acceleration hardware produced by different manufacturers such as TPU, NPU, ASIC, and FPGA have emerged. Due to differences in technical architecture and atomic algorithms, the same application for different hardware manufacturers will also have differences in the compiled binary files.

[0046] like Figure 1 As shown, Figure 1 This is a schematic diagram showing the incompatibility of binary files currently output by different manufacturers; the compiler consists of a front-end, a middle-end, and a back-end. Due to the differences in memory models, execution models, and instruction models of different hardware manufacturers, the compilers of various manufacturers are incompatible with each other. Although the final compiled binary files are composed of header files, program headers, host program code segments, and device program code segments (where the header file describes the information of the entire binary file and the supported operating system, and the program header describes the relevant information of the program code), the information actually stored in the files is also different. Program codes from different manufacturers cannot be parsed by each other and cannot run on hardware devices other than their own.

[0047] Based on this, in view of the above situation, it is cumbersome to deploy the same application on different hardware devices in a mixed heterogeneous scenario for diverse heterogeneous computing power. Developers must generate multiple binary files for the same application and manually adapt to different hardware manufacturers, which wastes resources and increases costs.

[0048] The embodiment of the present application provides a mapping method for a flow file, which is applied to an electronic device. The function implemented by the method can be implemented by calling a program code by a processor in the electronic device. Of course, the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium. As an example, the electronic device can be a mobile phone, a computer, a terminal, an information transceiver device, a tablet device, a personal digital assistant, etc.

[0049] Figure 2 A schematic diagram of a flow file mapping method flow is provided for an embodiment of the present application; Figure 2 As shown, the method includes:

[0050] Step 201: Acquire multiple first code files corresponding to different manufacturers;

[0051] Step 202: parsing the plurality of first code files respectively to obtain first information of a first file header segment and second information of a program header segment in each of the first code files;

[0052] Step 203: Combine the first information and the second information to generate a second code file corresponding to the plurality of first code files.

[0053] Step 204: Send the second code file to the different manufacturers; the second code file is used for each of the different manufacturers to obtain the required compiler code and execute it.

[0054] In step 201, a plurality of first code files corresponding to different manufacturers are obtained; wherein the different manufacturers can be determined according to actual conditions and are not limited here. As an example, the different manufacturers can include different hardware manufacturers, and the different hardware manufacturers can be understood as existing manufacturers. The first code file can be determined according to actual conditions and are not limited here. As an example, the first code file can be a binary file.

[0055] In step 202, the first code files are parsed respectively to obtain the first information of the first file header and the second information of the program header in each of the first code files; wherein the first information and the second information can be determined according to actual conditions and are not limited here. As an example, the first information can be file information; the second information can be program content information.

[0056] In step 203, the first information and the second information are combined and processed to generate a second code file corresponding to the plurality of the first code files; the second code file can be determined according to actual conditions and is not limited here. As an example, the second code file may include a second file header segment, a flow file descriptor, a code package descriptor, and an attribute set, and the combination of the first information and the second information to generate a second code file corresponding to the plurality of the first code files may include mapping the first information to the second file header segment and the flow file descriptor and mapping the second information to the code package descriptor and the attribute set to obtain the second code file.

[0057] In step 204, the second code file is used for each of the different manufacturers to obtain the required compiler code and execute it. It can be understood that each manufacturer can obtain the compiler code it needs and execute it, thereby realizing the cross-architecture flow and operation of the same application and the same binary file.

[0058] In actual applications, a binary file packager is used to parse and extract compiler codes from various manufacturers. The compiler codes from multiple different manufacturers are packaged into one file using a unified mapping method. Each manufacturer can identify and parse this unified file, extract the compiler code it needs and execute it, thereby realizing the cross-architecture flow and operation of the same application and the same binary file.

[0059] The solution of the embodiment of the present application is to parse multiple first code files corresponding to different manufacturers respectively to obtain the first information of the first file header segment and the second information of the program header segment in each first code file; combine the first information and the second information to generate a second code file corresponding to the multiple first code files; send the second code file used by each of the different manufacturers to obtain the required compiled program code and execute it to different manufacturers; that is, the compiled program codes of different manufacturers are changed from being carried by multiple files to being carried by one file in a unified format, thereby realizing the cross-architecture flow of the same file between different computing architectures and reducing adaptation overhead.

[0060] In one embodiment, the second code file includes a second file header segment, a flow file descriptor, a code package descriptor, and an attribute set, and the combining and processing of the first information and the second information to generate a second code file corresponding to the plurality of the first code files includes:

[0061] The first information is mapped to the second file header segment and the flow file descriptor, and the second information is mapped to the code package descriptor and the attribute set to obtain the second code file.

[0062] Among them, the second file header, the flow file descriptor, the code package descriptor and the attribute set can all be determined according to the actual situation, and are not limited here. As an example, the second file header can be a header file, which can be carried by a structure, which is a general description of the new binary file, including the attributes of the file, whether the file is executable, the target operating system and the location information of the unified flow file overall descriptor. The flow file descriptor can be a unified flow file overall descriptor, which can be a structure. The code package descriptors of different manufacturers are different. It is a description of a certain code package, including the device manufacturer type, runtime compilation options, runtime linking (marking whether the compiled code needs to link other shared object files (Shared Object file, SO file), program code location information, code package attribute set location information, etc. The attribute set can be understood as a feature description for a certain manufacturer's program code, including the instruction set type of the program code (the same manufacturer may have different instruction sets), supported data types, data location information, parameter location information (for users using deep learning frameworks), whether to quantize (for users using deep learning frameworks) and other information.

[0063] In one embodiment, the first code file includes policy information; the second code file includes code package descriptors of each manufacturer; and the method further includes:

[0064] Mapping the policy information to the data segment of the streaming file descriptor, and generating first position information of the policy information in the streaming file descriptor;

[0065] The first location information is mapped to the code package descriptor.

[0066] Among them, the first code file includes policy information; the policy information can be determined according to actual conditions and is not limited here; as an example, the policy information may include user policy, which can be understood as the operation strategy formulated by the user for computing devices of different back-end manufacturers, and may include information such as specifying that the program runs on a certain computing device and setting priorities for computing devices.

[0067] The second code file includes the code package descriptors of the various manufacturers; the code package descriptors of the various manufacturers can be determined according to actual conditions and are not limited here; as an example, the code package descriptors of the various manufacturers can be simply referred to as code package descriptors, which can be a structure. The code package descriptors of different manufacturers are different, which is a description of a certain code package, including device manufacturer type, runtime compilation options, runtime linking (marking whether the compiled code needs to link other SO files), program code location information, code package attribute set location information, and other contents.

[0068] The policy information is mapped to the data segment of the flow file descriptor, and the first position information of the policy information in the flow file descriptor is generated; wherein the first position information can be determined according to the actual situation and is not limited here; as an example, the first position information can be understood as relative position information. In actual applications, the binary file packager receives the policy information sent by the user, maps it to the data segment of the unified flow file, and generates relative position information.

[0069] The first location information is mapped to the code package descriptor.

[0070] In one embodiment, the first information includes information on whether the file is executable, target operating system information, link type information, and target hardware information in the first file header segment; and mapping the first information to the second file header segment and the flow file descriptor includes:

[0071] Mapping the information on whether the file is executable, the target operating system information, and the link type information to the second file header segment;

[0072] The target hardware information is mapped to the flow file descriptor.

[0073] It should be noted that the first information includes whether the file in the first file header segment is executable, target operating system information, link type information, and target hardware information; wherein the executable information can be simply referred to as executable; the target operating system information can be simply referred to as target operating system; and the link type information can be simply referred to as link type.

[0074] For ease of understanding, an example is given here to map the information of whether the file in the header file is executable, the target operating system, and the link type to the header file of the new binary file, store the target hardware information in the vendor descriptor, and find the program header through the location information. The vendor program code is found through the location information of the program header, the program code is mapped to the program code segment of the new file, and the relative position information of the program code is saved. At the same time, the content containing the vendor compilation characteristics in the program header is mapped to the attribute set, such as the type of compilation instructions, whether a link is required, and other information, and a relative position is generated. The location information and attribute set location information of the newly generated program codes of different vendors are mapped one by one to the code package descriptor of each vendor. All the location information of all vendor code package descriptors and the location information of user policies are mapped to the descriptor of the unified flow file, and the mapping of the number of code packages is increased.

[0075] In one embodiment, the first information includes location information of the carried program code; the second code file also includes program code segments and code package descriptors of each manufacturer; and the method further includes:

[0076] determining the program codes of the respective manufacturers based on the location information;

[0077] Mapping the program code to the program code segment and generating second position information of the program code in the program code segment;

[0078] The second location information is mapped to the code package descriptor.

[0079] The first information includes location information of the carried program code; the location information of the program code can be determined according to actual conditions and is not limited here; as an example, the location information of the program code can be relative location information of the program code.

[0080] The second code file also includes a program code segment which can be understood as a program code segment of a new file.

[0081] For ease of understanding, an example is given here to find the manufacturer's program code through the location information of the program header, map the program code to the program code segment of the new file, and save the relative location information of the program code. At the same time, the content containing the manufacturer's compilation characteristics in the program header is mapped to the attribute set, such as the type of compilation instructions, whether linking is required, and other information, and a relative position is generated. The location information and attribute set location information of the newly generated program codes of different manufacturers are mapped one by one to the code package descriptor of each manufacturer.

[0082] In one embodiment, the first information includes third location information of the descriptor of each of the different manufacturers and fourth location information of the user policy; the method further includes:

[0083] The third position information and the fourth position information are mapped into the streaming file descriptor.

[0084] In this embodiment, the third location information of the descriptor of each of the different manufacturers can be understood as the location information of the code package descriptors of all manufacturers. The fourth location information of the user policy can be understood as the location information of the user policy.

[0085] For ease of understanding, an example is given here to map all the vendor code package descriptor location information and user policy location information to the descriptor of the unified flow file, and increase the mapping of the number of code packages.

[0086] Based on this, in one embodiment, the method further includes:

[0087] Determine third information of the memory size of the second code file, fifth position information of the flow file descriptor, and fourth information of the memory size of the second file header segment;

[0088] The third information, the fifth position information, and the fourth information are mapped into the second file header segment.

[0089] In this embodiment, the third information, the fifth position information, and the fourth information can be determined according to actual conditions and are not limited here; as an example, the third information can be understood as the memory size of the file; the fifth position information can be understood as the relative position of the unified flow file binary descriptor; the fourth information can be understood as the size of the header file.

[0090] For ease of understanding, an example is given here to illustrate the mapping of multiple vendor files to a unified binary transfer file, calculate the memory size of the entire file, the relative position of the unified transfer file binary descriptor, the size of the header file, and finally map them all to the header file.

[0091] The mapping method of the transfer file can be determined according to the actual situation and is not limited here. As an example, the mapping method of the transfer file can be a unified binary transfer file mapping method. This application proposes a unified binary transfer file mapping method for a diverse mixed heterogeneous computing power scenario, such as Figure 3 As shown, Figure 3 A mapping diagram of a unified binary transferable file for an embodiment of the present application; through a binary file packager, the compiler codes of each manufacturer are parsed and extracted, and the compiler codes of multiple different manufacturers are packaged in one file using a unified mapping method. Each manufacturer can identify and parse this unified file, extract the compiler code it needs and execute it, thereby realizing the cross-architecture transfer and operation of the same application and the same binary file.

[0092] The contents carried in the binary files generated by various manufacturers for the same application can be divided into file information and program content information carried by the file. The file information is placed in the file header segment, which describes the information of the entire file, mainly including the attributes of the file, whether the file is executable, the target operating system, the link type, the location information of the program code carried, the target hardware, etc. The program content information carried by the file is distributed in the program header, the host-side compiled code, and the device-side compiled code. The program header is a description of the entire manufacturer's program, including information about program loading, such as the storage location of the compiled program code, the size of the compiled program code, and the data address of the program loading. It will also include some contents of the compilation characteristics of each manufacturer, such as specifying the type of compilation instructions (the same hardware device may be able to undertake two types of compilation instructions), whether linking is required, and other information.

[0093] The unified transfer file proposed in this application is generated by adding a binary file packager to the back end of the compiler code generator of different manufacturers. This packager parses and maps the binary code files generated by the compilers of different manufacturers to merge the code packages into one file. The specific implementation can be combined with Figure 4 To understand, Figure 4 This is a schematic diagram of mapping compiled codes of different manufacturers to a unified flow file in an embodiment of the present application.

[0094] The binary file packager receives files from different vendors and reassembles the information into a new binary file. The new binary file includes code package descriptors, code packages, code package attribute sets, a unified flow file descriptor, header files, and user policies from different vendors, such as Figure 4 As shown, where:

[0095] Header file: The structure carries information and is an overall description of the new binary file, including the file's attributes, whether the file is executable, the target operating system, and the location information of the unified flow file overall descriptor.

[0096] Unified flow file overall descriptor: This descriptor is a structure used to describe the information of code packages from different manufacturers, including the location information of multiple code packages, the number of code packages, and the location information of user policies.

[0097] Code package descriptor: This descriptor is a structure. The code package descriptors of different manufacturers are different. It is a description of a certain code package, including the device manufacturer type, runtime compilation options, runtime linking (marking whether the compiled code needs to link other SO files), program code location information, code package attribute set location information, etc.

[0098] Code package: The compiled content of a certain manufacturer, including host program code and device program code.

[0099] Attribute set: It is a characteristic description of a certain manufacturer's program code, including the instruction set type of the program code (the same manufacturer may have different instruction sets), supported data types, data location information, parameter location information (for users using deep learning frameworks), whether it is quantized (for users using deep learning frameworks), and other information.

[0100] User policy: The operation policy formulated by the user for computing devices of different back-end manufacturers, which may include information such as specifying that a program runs on a certain computing device and setting priorities for computing devices.

[0101] When multiple vendors' program codes are mapped to the same file, the binary file packager will mark and parse each vendor's file, and then map the information in the parsed header files of each vendor to the header file and unified flow descriptor of the new binary file, and map the information in the program header to the code package descriptor and attribute set. The specific mapping process can be combined with Figure 5 To understand, Figure 5 This is a schematic diagram of the mapping process of different manufacturers' compiled codes to a unified flow file in the embodiment of this application. Figure 5 As shown, there are seven steps in total:

[0102] Step 1: The binary file packager receives the policy information sent by the user, maps it to the data segment of the unified flow file, and generates relative position information.

[0103] Step 2: Generate header files, unify the overall descriptor of the flow file, the code package descriptors and attribute sets of each manufacturer, parse the file headers of each manufacturer, map the information in the header file about whether the file is executable, the target operating system and the link type to the header file of the new binary file, store the target hardware information in the manufacturer descriptor, and find the program header through the location information.

[0104] Step 3: Find the manufacturer's program code through the location information of the program header, map the program code to the program code segment of the new file, and save the relative location information of the program code. At the same time, map the content containing the manufacturer's compilation characteristics in the program header to the attribute set, such as the type of compilation instructions, whether linking is required, etc., and generate a relative position.

[0105] Step 4: Map the location information and attribute set location information of the newly generated program codes of different manufacturers to the code package descriptor of each manufacturer one by one.

[0106] Step 5: Map all the vendor code package descriptor location information and user policy location information to the descriptor of the unified flow file, and increase the mapping of the number of code packages.

[0107] Step 6: The mapping of multiple vendor files to the unified binary transfer file has been completed, and the memory size of the entire file, the relative position of the unified transfer file binary descriptor, the size of the header file are calculated, and finally mapped to the header file.

[0108] Step 7: Complete the packaging process and generate a unified binary transfer file.

[0109] This application protects program codes and user policies of multiple different manufacturers stored in a unified format binary flow file.

[0110] For multiple segments of compiled program code and user policies, there is a binary flow file in a unified format, which requires a complete mapping method. This application protects the mapping relationship and mapping method between the code package descriptor, code package, code package attribute set, unified flow file descriptor, header file and user policy of the unified binary flow file.

[0111] Compared with the prior art, the technical advantages of this application are as follows:

[0112] 1. For a variety of computing hardware devices, the compiler codes of different manufacturers are carried by a file in a unified format instead of multiple files, which enables the cross-architecture flow of the same file between different computing architectures and reduces adaptation overhead. At the same time, this binary file is scalable and does not limit the compiler code of the manufacturer. It can be different hardware expressions or different instruction levels of the same manufacturer.

[0113] 2. This application proposes to add user-defined strategies for various computing devices into the binary file, thereby increasing the user's ability to independently select backend computing devices.

[0114] In order to implement the method of the embodiment of the present application, the embodiment of the present application also provides a mapping device 600 for a flow file, which is arranged on an electronic device, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of a mapping device for a flow file according to an embodiment of the present application; the device 600 includes:

[0115] An acquisition unit 601 is used to acquire a plurality of first code files corresponding to different manufacturers;

[0116] A parsing unit 602 is used to parse the plurality of first code files respectively to obtain first information of a first file header segment and second information of a program header segment in each of the first code files;

[0117] A processing unit 603 is used to combine the first information and the second information to generate a second code file corresponding to the plurality of first code files;

[0118] The sending unit 604 is used to send the second code file to the different manufacturers; the second code file is used for each of the different manufacturers to obtain the required compiler code and execute it.

[0119] Here, in one embodiment, the second code file includes a second file header segment, a flow file descriptor, a code package descriptor and an attribute set, and the processing unit 603 is also used to map the first information to the second file header segment and the flow file descriptor and to map the second information to the code package descriptor and the attribute set to obtain the second code file.

[0120] Here, in one embodiment, the first code file includes policy information; the second code file includes the code package descriptors of the various manufacturers; the device 600 also includes a mapping unit, which is used to map the policy information to the data segment of the streaming file descriptor and generate the first position information of the policy information in the streaming file descriptor; and map the first position information to the code package descriptor.

[0121] Here, in one embodiment, the first information includes whether the file is executable information, target operating system information, link type information, and target hardware information in the first file header segment; the mapping unit is also used to map the file executable information, the target operating system information, and the link type information to the second file header segment; and map the target hardware information to the flow file descriptor.

[0122] Here, in one embodiment, the first information includes location information of the carried program code; the second code file also includes a program code segment and a code package descriptor of each manufacturer; the mapping unit is further used to determine the program code of each manufacturer based on the location information; map the program code to the program code segment, and generate second location information of the program code in the program code segment; map the second location information to the code package descriptor.

[0123] Here, in one embodiment, the first information includes the third position information of the descriptors of each of the different manufacturers and the fourth position information of the user policy; the mapping unit is also used to map the third position information and the fourth position information to the flow file descriptor.

[0124] Here, in one embodiment, the mapping unit is also used to determine the third information of the memory size of the second code file, the fifth position information of the flow file descriptor, and the fourth information of the memory size of the second file header segment; and map the third information, the fifth position information, and the fourth information to the second file header segment.

[0125] It should be noted that: the mapping device for the flow file provided in the above embodiment only uses the division of the above program modules as an example when mapping the flow file. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the mapping device for the flow file provided in the above embodiment and the embodiment of the mapping method for the flow file belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0126] Based on the hardware implementation of the above-mentioned program module, an embodiment of the present application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the mapping method of the flow file provided in the above-mentioned embodiment are implemented.

[0127] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the mapping method of the flow file provided in the above embodiment are implemented.

[0128] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0129] It should be noted that Figure 7 is a schematic diagram of a hardware entity structure of an electronic device in an embodiment of the present application, such as Figure 7 As shown, the hardware entity of the electronic device 700 includes: a processor 701 and a memory 703 . Optionally, the electronic device 700 may also include a communication interface 702 .

[0130] It can be understood that the memory 703 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be 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), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be 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 random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 703 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0131] The method disclosed in the above embodiment of the present application can be applied to the processor 701, or implemented by the processor 701. The processor 701 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software. The above processor 701 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 701 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 703, and the processor 701 reads the information in the memory 703 and completes the steps of the above method in combination with its hardware.

[0132] In an exemplary embodiment, the device may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0133] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0134] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0135] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0136] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0137] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0138] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A mapping method for a flow file, characterized in that: include: Obtain multiple first code files corresponding to different manufacturers; Parse the plurality of first code files respectively to obtain first information of a first file header segment and second information of a program header segment in each of the first code files; Combining the first information and the second information to generate a second code file corresponding to the plurality of the first code files; Sending the second code file to the different manufacturers; The second code file is used for each of the different manufacturers to obtain the required compiler code and execute it.

2. The method according to claim 1, characterized in that The second code file includes a second file header segment, a flow file descriptor, a code package descriptor, and an attribute set, and the combining and processing of the first information and the second information to generate a second code file corresponding to the plurality of the first code files includes: The first information is mapped to the second file header segment and the flow file descriptor, and the second information is mapped to the code package descriptor and the attribute set to obtain the second code file.

3. The method according to claim 2, characterized in that The first code file includes policy information; the second code file includes code package descriptors of each manufacturer; the method further includes: Mapping the policy information to the data segment of the streaming file descriptor, and generating first position information of the policy information in the streaming file descriptor; The first location information is mapped to the code package descriptor.

4. The method according to claim 2, characterized in that: The first information includes information on whether the file in the first file header is executable, target operating system information, link type information, and target hardware information; The mapping the first information to the second file header segment and the flow file descriptor includes: Mapping the information on whether the file is executable, the target operating system information, and the link type information to the second file header segment; The target hardware information is mapped to the flow file descriptor.

5. The method according to claim 2, characterized in that: The first information includes location information of the carried program code; the second code file also includes program code segments and code package descriptors of each manufacturer; the method further includes: determining the program codes of the respective manufacturers based on the location information; Mapping the program code to the program code segment and generating second position information of the program code in the program code segment; The second location information is mapped to the code package descriptor.

6. The method according to claim 2, characterized in that The first information includes third location information of the descriptor of each of the different manufacturers and fourth location information of the user policy; the method further includes: The third position information and the fourth position information are mapped into the streaming file descriptor.

7. The method according to any one of claims 2 to 6, characterized in that: The method further comprises: Determine third information of the memory size of the second code file, fifth position information of the flow file descriptor, and fourth information of the memory size of the second file header segment; The third information, the fifth position information, and the fourth information are mapped into the second file header segment.

8. A mapping device for a flow file, characterized in that: include: An acquisition unit, used to acquire a plurality of first code files corresponding to different manufacturers; A parsing unit, used for parsing the plurality of first code files respectively, to obtain first information of a first file header segment and second information of a program header segment in each of the first code files; a processing unit, configured to combine and process the first information and the second information to generate a second code file corresponding to the plurality of the first code files; A sending unit, configured to send the second code file to the different manufacturers; The second code file is used for each of the different manufacturers to obtain the required compiler code and execute it.

9. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, configured to implement the method for mapping a flow file according to any one of claims 1 to 7 when executing executable instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to implement the mapping method of the flow file described in any one of claims 1 to 7 when executed by a processor.