Data processing method and apparatus

WO2026091580A9PCT designated stage Publication Date: 2026-08-06HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2025-06-25
Publication Date
2026-08-06

Smart Images

  • Figure CN2025103240_06082026_PF_FP_ABST
    Figure CN2025103240_06082026_PF_FP_ABST
Patent Text Reader

Abstract

A data processing method, comprising: executing a first code block to obtain a first result; when a lead associated with the first code block indicates redundant execution of the first code block, executing a second code block by means of at least one redundancy instance, so as to obtain at least one second result, wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used for implementing the same function; and on the basis of the first result and the at least one second result, determining an execution result of the first code block. In the present application, redundant execution can be set for key functions in a code file, instead of for the whole code file, which can reduce the execution overhead while ensuring the reliability of function execution.
Need to check novelty before this filing date? Find Prior Art

Description

A data processing method and apparatus

[0001] This application claims priority to Chinese Patent Application No. 202411527185.1, filed on October 29, 2024, entitled “A Data Processing Method and Apparatus”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of artificial intelligence, and more particularly to a data processing method and apparatus thereof. Background Technology

[0003] When critical systems or business operations require high reliability, multi-mode redundancy is one of the most necessary and effective reliability mechanisms. The related process involves redundant execution of identical inputs to hardware modules and software programs, and arbitration of the outputs of redundant objects. Instances of redundant objects typically include identical instruction streams, backup data, redundant processes, etc. For example, to identify potential errors in redundant instances, it is necessary to verify whether the redundant instances meet expectations at a designated arbitration point, such as comparing whether the output values ​​between instances are consistent.

[0004] However, existing technologies suffer from high computational overhead and low resource utilization when redundant execution occurs. Summary of the Invention

[0005] In a first aspect, this application provides a data processing method, the method comprising: executing a first code block to obtain a first result; when a preamble associated with the first code block indicates that the first code block is redundantly executed, executing a second code block through at least one redundant instance to obtain at least one second result; wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used to implement the same function; and determining the execution result of the first code block based on the first result and the at least one second result.

[0006] A code block can contain one or more functions, or one or more statements, such as labeled statements, expression statements, compound statements, selection statements, loop statements, and jump statements. The first code block can be a subset of the code file.

[0007] In this embodiment, a preamble can be used to instruct redundant execution of function-level objects. Compared to redundant execution of the entire file, redundant execution at the function level has a smaller granularity, thus enabling more refined redundant execution. The advantage of this is that redundant execution can be set for key functions in the code file, rather than all of them, which can reduce execution overhead while ensuring the reliability of function execution.

[0008] In one possible implementation, before executing the first code block, a code file to be executed, including the first code block, can be obtained. The compiler then adds the directive associated with the first code block to the code file. That is, at compile time, directives can be added to one or more functions in the original code file, indicating redundant execution of the associated functions. By adding pre-arranged multimodal directives through the compiler, static pre-arrangement of the multimodal redundancy execution strategy is achieved, enabling finer-grained multimodal redundancy.

[0009] In one possible implementation, the code file contains multiple code blocks, including the first code block; the method further includes: based on the multiple code blocks, using a machine learning model, determining which code blocks, including the first code block, need to have instructions added for redundant execution. This identification of which code blocks in the code file need to have instructions added can be achieved through AI (but not limited to AI methods, such as other mapping methods).

[0010] In one possible implementation, adding the directive associated with the first code block to the code file via the compiler includes: when the first code block is a fragile function in the code file, adding the directive associated with the first code block to the code file via the compiler, wherein the fragile function is a function whose execution reliability is below a threshold.

[0011] Vulnerable functions can be functions that interact with (or interact with multiple times) the hardware. Due to their complex processing flow, these functions often have lower reliability (that is, the possibility of incorrect execution results is greater). Therefore, vulnerable functions in the code file can be identified during compilation, and then a directive associated with the vulnerable function can be added to the code file to indicate redundant execution.

[0012] In one possible implementation, adding the lead associated with the first code block to the code file via the compiler includes: adding the lead associated with the first code block to the code file via the compiler when at least one of available computing resources, computing load, available communication resources, and communication load meets a preset condition.

[0013] For example, if it is determined that there are many available resources based on at least one of available computing resources, computing load, available communication resources, and communication load, the compiler can add the lead associated with the first code block to the code file.

[0014] In one possible implementation, the lead includes at least one of the following information: the number of redundant instances performing the redundant operation, the start time of performing the redundant operation, the stop time of performing the redundant operation, and the duration of performing the redundant operation.

[0015] In one possible implementation, the lead specifically indicates that the first code block is redundantly executed when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition.

[0016] In other words, the preamble can indicate that redundant execution will only be triggered when certain conditions are met. This approach can be called dynamic multi-mode redundant execution. By adding dynamic multi-mode preambles to the compiler, it is possible to dynamically perform multi-mode redundant execution on key logic at runtime based on system resource monitoring calls, load conditions, and program configuration. It also supports flexible adjustment of redundant execution according to actual needs, achieving more refined reliability assurance with lower resource consumption.

[0017] In one possible implementation, the redundant instance is a thread.

[0018] Secondly, this application provides a data processing apparatus, the apparatus comprising:

[0019] The main execution module is used to execute the first code block and obtain the first result;

[0020] A redundant execution module is configured to execute a second code block through at least one redundant instance when a preamble associated with the first code block indicates that the first code block should be redundantly executed, thereby obtaining at least one second result; wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used to perform the same function; and to determine the execution result of the first code block based on the first result and the at least one second result.

[0021] In one possible implementation, the device further includes:

[0022] A compilation module is used to obtain a code file to be executed before executing the first code block, the code file including the first code block;

[0023] Add the lead associated with the first code block to the code file.

[0024] In one possible implementation, the compilation module is specifically used for:

[0025] When the first code block is a fragile function in the code file, the compiler adds the introduction associated with the first code block to the code file, wherein the fragile function is a function whose execution reliability is below a threshold.

[0026] In one possible implementation, the compilation module is specifically used for:

[0027] When at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition, the compiler adds the lead associated with the first code block to the code file.

[0028] In one possible implementation, the lead includes at least one of the following information:

[0029] The number of redundant instances performing the redundancy operation, the start time of the redundancy operation, the stop time of the redundancy operation, and the duration of the redundancy operation.

[0030] In one possible implementation, the lead specifically indicates that the first code block is redundantly executed when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition.

[0031] In one possible implementation, the redundant instance is a thread.

[0032] Thirdly, embodiments of this application provide a data processing apparatus, which may include a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the first aspect above and any of its optional methods.

[0033] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any of its optional methods.

[0034] Fifthly, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the first aspect and any of its optional methods described above.

[0035] Sixthly, this application provides a chip system including a processor for supporting the execution of data processing devices to perform the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for a terminal device or server. This chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description

[0036] Figure 1 is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0037] Figures 2 to 6 are schematic diagrams of the application system framework provided in the embodiments of this application;

[0038] Figure 7 is a schematic diagram of a data processing device provided in an embodiment of this application;

[0039] Figure 8 is a schematic diagram of a terminal device provided in an embodiment of this application;

[0040] Figure 9 is a schematic diagram of a server structure provided in an embodiment of this application. Detailed Implementation

[0041] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the invention.

[0042] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0043] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0044] The terms “substantially,” “about,” and similar terms used herein are used as approximations rather than as terms of degree, and are intended to take into account the inherent biases of measurements or calculations known to those skilled in the art. Furthermore, the use of “may” in describing embodiments of the invention refers to “one or more possible embodiments.” The terms “use,” “using,” and “used” used herein are to be considered synonymous with the terms “utilize,” “utilizing,” and “utilized,” respectively. Additionally, the term “exemplary” is intended to refer to an instance or illustration.

[0045] When critical systems or business operations require high reliability, multi-mode redundancy is one of the most necessary and effective reliability mechanisms. The related process involves redundant execution of identical inputs to hardware modules and software programs, and arbitration of the outputs of redundant objects. Instances of redundant objects typically include identical instruction streams, backup data, redundant processes, etc. For example, to identify potential errors in redundant instances, it is necessary to verify whether the redundant instances meet expectations at a designated arbitration point, such as comparing whether the output values ​​between instances are consistent.

[0046] However, existing technologies suffer from high computational overhead and low resource utilization when redundant execution occurs.

[0047] To address the aforementioned problems, embodiments of this application provide a data processing method. The data processing method of this application embodiment will be described in detail below with reference to the accompanying drawings.

[0048] Referring to Figure 1, which is a flowchart of a data processing method provided in an embodiment of this application, as shown in Figure 1, the data processing method provided in an embodiment of this application may include steps 101 to 103, which will be described in detail below.

[0049] 101. Execute the first code block and obtain the first result;

[0050] The first result can be obtained by executing the first code block on the main thread;

[0051] 102. When the preface associated with the first code block indicates that the first code block is redundantly executed, the second code block is executed through at least one redundant instance to obtain at least one second result; wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used to implement the same function;

[0052] In this embodiment, a preamble can be used to instruct redundant execution of function-level objects. Compared to redundant execution of the entire file, redundant execution at the function level has a smaller granularity, thus enabling more refined redundant execution. The advantage of this is that redundant execution can be set for key functions in the code file, rather than all of them, which can reduce execution overhead while ensuring the reliability of function execution.

[0053] In one possible implementation, before executing the first code block, a code file to be executed, including the first code block, can be obtained. The compiler then adds the directive associated with the first code block to the code file. That is, at compile time, directives can be added to one or more functions in the original code file, indicating redundant execution of the associated functions. By adding pre-arranged multimodal directives through the compiler, static pre-arrangement of the multimodal redundancy execution strategy is achieved, enabling finer-grained multimodal redundancy.

[0054] In one possible implementation, when the first code block is a fragile function in the code file, the compiler may add the introduction associated with the first code block to the code file, wherein the fragile function is a function whose execution reliability is below a threshold.

[0055] Vulnerable functions can be functions that interact with (or interact with multiple times) the hardware. Due to their complex processing flow, these functions often have lower reliability (that is, the possibility of incorrect execution results is greater). Therefore, vulnerable functions in the code file can be identified during compilation, and then a directive associated with the vulnerable function can be added to the code file to indicate redundant execution.

[0056] In one possible implementation, the compiler may add the lead associated with the first code block to the code file when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition.

[0057] For example, if it is determined that there are many available resources based on at least one of available computing resources, computing load, available communication resources, and communication load, the compiler can add the lead associated with the first code block to the code file.

[0058] In one possible implementation, the lead includes at least one of the following information: the number of redundant instances performing the redundant operation, the start time of performing the redundant operation, the stop time of performing the redundant operation, and the duration of performing the redundant operation.

[0059] In one possible implementation, the redundant instance can be a thread.

[0060] For example, based on system resource data collected by the resource monitoring module, such as CPU load, memory usage, I / O status, network traffic, and vulnerable functions, a static policy table (e.g., a list of functions) can be generated. A "pre-arrangement directive" can be manually inserted into the business code, or a script can be used to insert the "pre-arrangement directive" into specified code according to defined rules. When the program loads, multiple copies of the functions modified by the "pre-arrangement directive" can be forked to execute the same computation task simultaneously. At the end of the computation task, the results are compared. If the results match, execution continues; if the results are inconsistent, arbitration is performed according to predetermined rules (e.g., the minority follows a certain rule), and the arbitration result is given and returned; if an accurate result cannot be arbitrated, the function specified by `onerror` is called for error handling.

[0061] In one possible implementation, the lead specifically indicates that the first code block is redundantly executed when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition.

[0062] In other words, the preamble can indicate that redundant execution will only be triggered when certain conditions are met. This approach can be called dynamic multi-mode redundant execution. By adding dynamic multi-mode preambles to the compiler, it is possible to dynamically perform multi-mode redundant execution on key logic at runtime based on system resource monitoring calls, load conditions, and program configuration. It also supports flexible adjustment of redundant execution according to actual needs, achieving more refined reliability assurance with lower resource consumption.

[0063] For example, a lightweight online resource real-time monitoring module can be used to monitor CPU load, memory usage, I / O status, network traffic, and other loads in real time, and periodically sample and update system status. Considering historical data and trend analysis, based on monitoring data and configuration strategies, various decision-making algorithms, such as threshold triggering, machine learning models, and fuzzy logic, can be used to generate a dynamic strategy table for redundant execution.

[0064] Afterwards, the execution of multi-mode redundancy can be dynamically controlled according to the dynamic strategy table, such as under what circumstances to start multi-mode redundancy and how long to execute it before stopping multi-mode redundancy.

[0065] Specifically, multiple replica threads can be forked to execute the same computation task simultaneously. Upon completion of the computation task, the results are compared. If the results match, execution continues; if the results are inconsistent, arbitration is performed according to predetermined rules (e.g., the minority follows a certain rule), and the arbitration result is given and returned; if an accurate result cannot be obtained through arbitration, the function specified by `onerror` is called for error handling.

[0066] 103. Determine the execution result of the first code block based on the first result and the at least one second result.

[0067] For example, during program loading, the function modified by the "pre-arrangement directive" can be forked into multiple copies of the thread to execute the same computation task simultaneously. At the end of the computation task, the results are compared. If the results match, execution continues; if the results are inconsistent, arbitration is performed according to predetermined rules (e.g., the minority follows a certain rule), and the arbitration result is given and returned; if an accurate result cannot be arbitrated, the function specified by onerror is called for error handling.

[0068] For example, referring to Figures 2 and 3, which are schematic diagrams of the execution flow of pre-arranged multi-mode redundant execution, the compiler automatically performs multi-threaded parallel verification in the pre-arranged multi-mode redundant execution.

[0069] For example, the code to be executed can be:

[0070] int main(){

[0071] int x = 0;

[0072] #pragma rmt_static_task check(x,compare)onerror(handler)

[0073] {

[0074] x = compute();

[0075] }

[0076] return 0;

[0077] In this code block, x = compute() is the first code block, and #pragma rmt_static_task check(x,compare)onerror(handler) is the preamble.

[0078] The compiler needs to be extended to recognize the `rmt_static_task` instruction and generate corresponding multi-threaded redundant execution code. When parsing the `rmt_static_task` instruction, the compiler inserts code to create two worker threads and ensure they execute on different cores. The compiler also needs to insert code to copy function input parameters and assign independent result variables to each thread. Regarding the handling of the `CHECK` and `ONERROR` clauses: the `CHECK` clause is used to specify the result variable, and the compiler needs to insert code to compare the results at the end of function execution. The `ONERROR` clause provides an alternative method for handling inconsistent results, and the compiler needs to generate appropriate error handling code.

[0079] In thread management, the system needs to maintain an efficient thread pool for rapid allocation and recycling of worker threads. The thread pool should support dynamic adjustment of the thread count to adapt to different load requirements. Thread affinity settings: Ensure worker threads execute on different cores to improve parallelism and performance. Thread affinity settings can be implemented through APIs provided by the operating system. Thread state monitoring: Implement a thread state monitoring mechanism to ensure correct thread execution and timely recycling.

[0080] In memory management, independent space for result variables can be allocated to each worker thread to avoid data conflicts between threads. The allocation and release of result variables need to be handled in the compiler-generated code. Memory copying: Implement an efficient memory copying mechanism for copying function input data. Memory copying can use hardware acceleration techniques (such as DMA) to improve efficiency. Temporary variable management: Manage the lifecycle of temporary variables to ensure that memory is released promptly after task execution, avoiding memory leaks.

[0081] For result verification, a fast result comparison algorithm supports comparison of various data types. The comparison algorithm needs to consider the precision of floating-point numbers and design a configurable fault tolerance threshold.

[0082] Regarding the three-way comparison logic: When an inconsistency is detected, an arbitration thread is initiated to perform a third calculation, and the new result is compared with the first two results. This efficient three-way comparison logic ensures the rapid completion of the arbitration process.

[0083] For error handling, a customizable error handling mechanism is provided, supporting multiple processing methods for the ONERROR clause. Logging and warning output functionality is also offered to facilitate debugging and monitoring for developers.

[0084] Program continuation or termination: Supports the program to choose to continue or terminate when results are inconsistent, providing flexible error handling options.

[0085] In terms of performance optimization, lightweight synchronization primitives are used to reduce inter-thread communication overhead and improve system performance. Synchronization primitives can be implemented using spinlocks, semaphores, etc. Intelligent scheduling strategies are implemented to balance the load and maximize parallelism. The scheduling strategy can be dynamically adjusted based on system resources and load conditions. Hardware acceleration leverages hardware features (such as SIMD instructions) to accelerate result comparison and arbitration processes, improving overall performance.

[0086] In terms of interface design, a concise TASK command syntax is used: A simple TASK command syntax is provided for ease of use by developers. The syntax of the TASK command is ensured to be compatible with existing programming languages. Flexible configuration options are provided: Flexible configuration options are designed to allow users to adjust redundant execution strategies according to actual needs. Configuration options can be set through compiler parameters or configuration files. Compatibility with existing code is ensured: Compatibility with existing code is guaranteed, facilitating the integration of this technology into existing projects.

[0087] This approach ensures computational reliability while minimizing the impact on system performance. It provides developers with a powerful and flexible tool to achieve highly reliable computation in critical applications, while maintaining code clarity and maintainability.

[0088] Referring to Figure 4, which illustrates dynamic multi-mode redundancy execution, and Figure 5, which illustrates a dynamic lead, the dynamic multi-mode lead design can adopt the general OpenMP style lead, such as "#pragma rmt_dynamic_task". The lead supports parameter configuration, such as redundancy and triggering conditions.

[0089] Example:

[0090] #pragma rmt_dynamic_task check(x,compare,trigger=cpu_load>80%)onerror(handler)

[0091] {

[0092] / / Key code block

[0093] }

[0094] Referring to Figure 6, which is a schematic diagram of an application architecture according to an embodiment of this application.

[0095] Referring to Figure 7, which is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application, as shown in Figure 7, the data processing apparatus 700 provided in an embodiment of this application includes:

[0096] The main execution module 701 is used to execute the first code block and obtain the first result.

[0097] For a detailed description of the main execution module 701, please refer to the description of step 101 in the above embodiments. The similarities will not be repeated here.

[0098] The redundant execution module 702 is configured to execute a second code block through at least one redundant instance when the preamble associated with the first code block indicates that the first code block is to be redundantly executed, and to obtain at least one second result; wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used to perform the same function; and to determine the execution result of the first code block based on the first result and the at least one second result.

[0099] For a detailed description of the redundant execution module 702, please refer to the description of step 102 in the above embodiment. The similarities will not be repeated here.

[0100] In one possible implementation, the device further includes:

[0101] A compilation module is used to obtain a code file to be executed before executing the first code block, the code file including the first code block;

[0102] Add the lead associated with the first code block to the code file.

[0103] In one possible implementation, the compilation module is specifically used for:

[0104] When the first code block is a fragile function in the code file, the compiler adds the introduction associated with the first code block to the code file, wherein the fragile function is a function whose execution reliability is below a threshold.

[0105] In one possible implementation, the compilation module is specifically used for:

[0106] When at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition, the compiler adds the lead associated with the first code block to the code file.

[0107] In one possible implementation, the lead includes at least one of the following information:

[0108] The number of redundant instances performing the redundancy operation, the start time of the redundancy operation, the stop time of the redundancy operation, and the duration of the redundancy operation.

[0109] In one possible implementation, the lead specifically indicates that the first code block is redundantly executed when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition.

[0110] In one possible implementation, the redundant instance is a thread.

[0111] The following describes a terminal device provided in an embodiment of this application. Please refer to Figure 8, which is a structural schematic diagram of a terminal device provided in an embodiment of this application. The terminal device 800 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop computer, a smart wearable device, etc., and is not limited here. Specifically, the terminal device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (the number of processors 803 in the terminal device 800 can be one or more; Figure 8 shows one processor as an example). The processor 803 may include an application processor 8031 ​​and a communication processor 8032. In some embodiments of this application, the receiver 801, transmitter 802, processor 803, and memory 804 can be connected via a bus or other means.

[0112] Memory 804 may include read-only memory and random access memory, and provides instructions and data to processor 803. A portion of memory 804 may also include non-volatile random access memory (NVRAM). Memory 804 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0113] The processor 803 controls the operation of the terminal device. In specific applications, the various components of the terminal device are coupled together through a bus system. This bus system includes not only the data bus but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0114] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 803. Processor 803 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the hardware of processor 803 or by instructions in software form. Processor 803 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 803 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 804, and processor 803 reads the information from memory 804 and, in conjunction with its hardware, completes the steps of the above method.

[0115] Receiver 801 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the terminal device. Transmitter 802 can be used to output digital or character information through the first interface; transmitter 802 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 802 may also include a display device such as a display screen.

[0116] This application also provides a server. Referring to Figure 9, which is a schematic diagram of a server structure provided in this application embodiment, the server 900 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 99 (e.g., one or more processors) and a memory 932, and one or more storage media 930 (e.g., one or more mass storage devices) for storing application programs 942 or data 944. The memory 932 and storage media 930 can be temporary or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 99 may be configured to communicate with the storage media 930 and execute the series of instruction operations in the storage media 930 on the server 900.

[0117] Server 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input / output interfaces 958; or one or more operating systems 941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0118] In this embodiment, the central processing unit 99 is used to execute the actions described in the above embodiments.

[0119] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned terminal device, or causes the computer to perform steps as performed by the aforementioned server.

[0120] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned terminal device, or causes the computer to perform steps as performed by the aforementioned server.

[0121] The terminal device, server, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip in the terminal device to execute the data processing method described in the above embodiments, or to cause the chip in the server to execute the data processing method described in the above embodiments. Optionally, the storage unit is a storage unit within the chip, such as a register or cache. The storage unit can also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, such as random access memory (RAM).

[0122] It should also be noted that the device embodiments described above are merely illustrative. 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 the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0124] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0125] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

Claims

1. A data processing method, characterized in that, The method includes: Execute the first code block to obtain the first result; the first code block is a subset of the code file. When the preamble associated with the first code block indicates that the first code block is redundantly executed, the second code block is executed through at least one redundant instance to obtain at least one second result; wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used to implement the same function; The execution result of the first code block is determined based on the first result and the at least one second result.

2. The method according to claim 1, characterized in that, Before executing the first code block, the method further includes: Obtain the code file to be executed, the code file including the first code block; The compiler adds the lead associated with the first code block to the code file.

3. The method according to claim 2, characterized in that, The code file contains multiple code blocks, including the first code block; The method further includes: Based on the multiple code blocks, a machine learning model is used to determine one or more code blocks, including the first code block, that need to have instructions added for redundant execution.

4. The method according to claim 2 or 3, characterized in that, The step of adding the lead associated with the first code block to the code file via the compiler includes: When the first code block is a fragile function in the code file, the compiler adds the introduction associated with the first code block to the code file, wherein the fragile function is a function whose execution reliability is below a threshold.

5. The method according to any one of claims 2 to 4, characterized in that, The step of adding the lead associated with the first code block to the code file via the compiler includes: When at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition, the compiler adds the lead associated with the first code block to the code file.

6. The method according to any one of claims 1 to 5, characterized in that, The lead includes at least one of the following information: The number of redundant instances performing the redundancy operation, the start time of the redundancy operation, the stop time of the redundancy operation, and the duration of the redundancy operation.

7. The method according to any one of claims 1 to 6, characterized in that, The intro specifically indicates that when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition, the first code block is executed redundantly.

8. The method according to any one of claims 1 to 7, characterized in that, The redundant instance is a thread.

9. A data processing apparatus, characterized in that, The device includes: The main execution module is used to execute the first code block and obtain the first result; the first code block is a subset of the code file. A redundant execution module is configured to execute a second code block through at least one redundant instance when a preamble associated with the first code block indicates that the first code block should be redundantly executed, thereby obtaining at least one second result; wherein the second code block is the same as or different from the first code block, and the second code block and the first code block are used to perform the same function; and to determine the execution result of the first code block based on the first result and the at least one second result.

10. The apparatus according to claim 9, characterized in that, The device further includes: A compilation module is used to obtain a code file to be executed before executing the first code block, the code file including the first code block; Add the lead associated with the first code block to the code file.

11. The apparatus according to claim 10, characterized in that, The compilation module is specifically used for: When the first code block is a fragile function in the code file, the compiler adds the introduction associated with the first code block to the code file, wherein the fragile function is a function whose execution reliability is below a threshold.

12. The apparatus according to claim 10, characterized in that, The compilation module is specifically used for: When at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition, the compiler adds the lead associated with the first code block to the code file.

13. The apparatus according to any one of claims 9 to 12, characterized in that, The intro specifically indicates that when at least one of the available computing resources, computing load, available communication resources, and communication load meets a preset condition, the first code block is executed redundantly.

14. The apparatus according to any one of claims 9 to 13, characterized in that, The redundant instance is a thread.

15. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which, when executed by one or more computers or processors, cause the one or more computers or processors to perform the method of any one of claims 1 to 8.

16. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on a computer device or processor, cause the computer device or processor to perform the method as described in any one of claims 1 to 8.

17. A system, characterized in that, It includes at least one processor and at least one memory; the at least one processor and the at least one memory are connected via a communication bus. The at least one memory is used to store code; The at least one processor is used to execute the code to perform the method as described in any one of claims 1 to 8.

18. A chip, comprising a processor, characterized in that, The processor is used to support the data processing device in implementing the method as described in any one of claims 1 to 8.