Processing method, device, computer equipment and storage medium

Through statement segmentation, pattern translation and splicing modules, source code statements are translated into object code statements, which solves the problem of cross-platform architecture, improves the scalability and reusability of the application software, and is suitable for a variety of platform environments.

CN112052040BActive Publication Date: 2024-11-05CAMBRICON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910492141.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-06
Publication Date
2024-11-05
Estimated Expiration
2040-05-04

AI Technical Summary

Technical Problem

The existing technology is difficult to implement the cross-platform architecture of application software in different platform environments, resulting in insufficient scalability and reusability of source code statements, and the operation efficiency of compiled software is inefficient, making it unable to be applicable to all platforms.

Method used

Through statement segmentation, pattern translation and statement splicing modules, the source code statements are divided into statement fragments and translated into intermediate code fragments according to the target encoding rules, and splicing them according to the target encoding rules to generate target code statements to realize the application and system The bridge and unity of the platform are suitable for all types of platform environments.

Benefits of technology

It improves the scalability and reusability of source code statements, is suitable for multiple programming languages, is fast in processing, is suitable for multi-platform environments, and realizes the unity of cross-platform architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112052040B_ABST
    Figure CN112052040B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a processing method, device, computer equipment and storage medium, which includes a combined processing device, the combined processing device includes: a machine learning operation device, a universal interconnection interface and other processing devices; the machine learning operation device interacts with other processing devices to jointly complete the calculation operation specified by the user, wherein the combined processing device also includes: a storage device, which is respectively connected to the machine learning operation device and the other processing devices, and is used to save the data of the machine learning operation device and the other processing devices. The processing method, device, computer equipment and storage medium provided by the embodiments of the present disclosure are applied between the underlying operating system and the application program, play the role of bridging and unifying the application program and the system platform, are applicable to various platform environments, are not limited by the programming language used in the source code statement, have a wide range of applications, and a fast processing speed, and improve the scalability and reusability of the source code statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a code compatibility processing method, apparatus, computer equipment and storage medium. Background Art

[0002] With the continuous development of computer technology, platform environments are diverse. Application software that performs the same business or task often needs to be used in different platform environments. This brings considerable challenges to application software design and development. How to protect the original intellectual achievements and enable application software to have good platform scalability and reusability to adapt to applications on various platforms has become an urgent problem to be solved. Summary of the invention

[0003] In view of this, the present disclosure proposes a code compatibility processing method, apparatus, computer device and storage medium.

[0004] According to one aspect of the present disclosure, a code compatibility processing device is provided, the device comprising: a statement segmentation module, a pattern translation module and a statement splicing module,

[0005] The sentence segmentation module is used to segment the received source code sentence to obtain at least one sentence fragment corresponding to the source code sentence, and send the at least one sentence fragment to the pattern translation module;

[0006] The pattern translation module is used to translate the at least one sentence fragment received according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, and send the at least one intermediate code fragment to the sentence splicing module;

[0007] The statement splicing module is used to identify the at least one intermediate code fragment received, perform statement splicing on the at least one intermediate code fragment according to the target coding rule, and obtain a target code statement.

[0008] The statement fragment includes at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to the source code statement.

[0009] According to a second aspect of the present disclosure, a machine learning computing device is provided, the device comprising:

[0010] One or more code compatibility processing devices as described in the first aspect above, used to obtain source code statements, data to be calculated and control information from other processing devices, and perform specified machine learning operations, and transmit the execution results to other processing devices through I / O interfaces;

[0011] When the machine learning computing device includes a plurality of the code compatibility processing devices, the plurality of the code compatibility processing devices may be connected and transmit data through a specific structure;

[0012] Among them, multiple code compatibility processing devices are interconnected and transmit data through a fast peripheral device interconnection bus PCIE bus to support larger-scale machine learning operations; multiple code compatibility processing devices share the same control system or have their own control systems; multiple code compatibility processing devices share memory or have their own memory; the interconnection method of multiple code compatibility processing devices is any interconnection topology.

[0013] According to a third aspect of the present disclosure, a combined processing device is provided, the device comprising:

[0014] The machine learning computing device, universal interconnection interface and other processing devices described in the second aspect above;

[0015] The machine learning computing device interacts with the other processing devices to jointly complete the computing operations specified by the user.

[0016] According to a fourth aspect of the present disclosure, a machine learning chip is provided, wherein the machine learning chip includes the machine learning network computing device described in the second aspect or the combined processing device described in the third aspect.

[0017] According to a fifth aspect of the present disclosure, a machine learning chip packaging structure is provided, which includes the machine learning chip described in the fourth aspect above.

[0018] According to a sixth aspect of the present disclosure, a board is provided, which includes the machine learning chip packaging structure described in the fifth aspect.

[0019] According to a seventh aspect of the present disclosure, an electronic device is provided, comprising the machine learning chip described in the fourth aspect or the board described in the sixth aspect.

[0020] According to an eighth aspect of the present disclosure, a code compatibility processing method is provided, which is applied to a code compatibility processing device, and the method includes:

[0021] Segmenting the received source code sentence to obtain at least one sentence fragment corresponding to the source code sentence;

[0022] Translating the received at least one sentence fragment according to a target encoding rule corresponding to the device to obtain at least one intermediate code fragment;

[0023] Identify the at least one intermediate code fragment received, perform sentence splicing on the at least one intermediate code fragment according to the target coding rule to obtain a target code sentence,

[0024] The statement fragment includes at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to the source code statement.

[0025] According to a ninth aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, and the computer program instructions implement the above-mentioned code compatibility processing method when executed by a processor.

[0026] The code compatibility processing method, device, computer equipment and storage medium provided by the embodiment of the present disclosure include a statement segmentation module, a mode translation module and a statement splicing module, wherein the statement segmentation module is used to segment the received source code statement to obtain at least one statement fragment corresponding to the source code statement, and send the at least one statement fragment to the mode translation module; the mode translation module is used to translate the at least one received statement fragment according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, and send the at least one intermediate code fragment to the statement splicing module; the statement splicing module is used to identify the at least one received intermediate code fragment, perform statement splicing on the at least one intermediate code fragment according to the target coding rule to obtain the target code statement, wherein the statement fragment includes at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate the processing operation corresponding to the source code statement. The code compatibility processing device provided by the embodiment of the present disclosure is applied between the underlying operating system and the application program, plays the role of bridging and unifying the application program and the system platform, is applicable to various platform environments, is not limited by the programming language used in the source code statement, has a wide range of applications, fast processing speed, and improves the scalability and reusability of the source code statement.

[0027] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0029] Figure 1 A block diagram of a code compatibility processing device according to an embodiment of the present disclosure is shown.

[0030] Figure 2A block diagram of a code compatibility processing device according to an embodiment of the present disclosure is shown.

[0031] Figure 3a , Figure 3b A block diagram of a combined processing device according to an embodiment of the present disclosure is shown.

[0032] Figure 4 A schematic structural diagram of a board according to an embodiment of the present disclosure is shown.

[0033] Figure 5 A flowchart of a code compatibility processing method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0035] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present disclosure indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0036] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.

[0037] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0038] In the related art, the application of the original software under the new system platform is realized by the following methods, for example, patching under the new system platform, that is, according to the differences between the various systems, designing a corresponding system compatibility package for the source target system under the new platform, reconstructing the system call interface of the application under the original system, and transplanting the application to the new platform based on the compatibility package, but this method requires technicians to make corresponding settings for different new system platforms, and cannot realize a complete cross-platform architecture. Alternatively, a cross-platform compiler software is used to realize its cross-platform characteristics in the code interpretation and execution stage, but the operating efficiency of the compiler software in this method is low, and it has limitations and is not applicable to all platforms, and cannot be well used in embedded systems. Based on this, the present disclosure provides a code compatibility processing method, device, computer equipment and storage medium, which can translate source code statements into target code statements corresponding to any target coding rules, which are applied between the underlying operating system and the application program, play the role of bridging and unifying the application program and the system platform, are applicable to various platform environments, are not limited by the programming language used for the source code statement, have a wide range of applications, fast processing speed, and improve the scalability and reusability of the source code statement.

[0039] Figure 1 FIG. 2 is a block diagram of a code compatibility processing device according to an embodiment of the present disclosure. Figure 1 As shown, the device includes a sentence segmentation module 11, a pattern translation module 12 and a sentence splicing module 13.

[0040] The statement segmentation module 11 is used to segment the received source code statement to obtain at least one statement segment corresponding to the source code statement, and send the at least one statement segment to the pattern translation module 12 .

[0041] The pattern translation module 12 is used to translate at least one received sentence fragment according to the target coding rule corresponding to the device, obtain at least one intermediate code fragment, and send the at least one intermediate code fragment to the sentence splicing module 13.

[0042] The statement splicing module 13 is used to identify at least one received intermediate code fragment, and perform statement splicing on the at least one intermediate code fragment according to the target coding rule to obtain a target code statement.

[0043] The statement fragment may include at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to a source code statement.

[0044] In this embodiment, the source code statement may be the source code corresponding to the application software or program, and the source code statement may be a code statement written in a programming language such as JAVA, C++, Windows, Unix, Android, etc. The target coding rule includes the programming language used by the device.

[0045] In this embodiment, a sub-device dedicated to implementing the above-mentioned sentence segmentation module, pattern translation module and sentence splicing module can be set to improve the efficiency of module operation.

[0046] In this embodiment, the source code statement can be split into a combination of at least one of a keyword group, a variable name, and an operator. The variable name and the operator can include one or more. The keyword group can indicate the function of the application or software corresponding to the source code statement, and can describe the arithmetic, logical, and other operations that the source code statement needs to perform on a target object such as data, or other processing operations on the target object.

[0047] The code compatibility processing device provided by the embodiment of the present disclosure includes a statement segmentation module, a pattern translation module and a statement splicing module, wherein the statement segmentation module is used to segment the received source code statement to obtain at least one statement fragment corresponding to the source code statement, and send the at least one statement fragment to the pattern translation module; the pattern translation module is used to translate the at least one statement fragment received according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, and send the at least one intermediate code fragment to the statement splicing module; the statement splicing module is used to identify the at least one intermediate code fragment received, and perform statement splicing on the at least one intermediate code fragment according to the target coding rule to obtain the target code statement, wherein the statement fragment includes at least one of a keyword group, a variable name and an operator, and the keyword group includes at least one keyword, and the keyword group is used to indicate the processing operation corresponding to the source code statement. The code compatibility processing device provided by the embodiment of the present disclosure is applied between the underlying operating system and the application program, plays the role of bridging and unifying the application program and the system platform, is applicable to various platform environments, is not limited by the programming language used in the source code statement, has a wide range of applications, fast processing speed, and improves the scalability and reusability of the source code statement.

[0048] In a possible implementation, segmenting the received source code statement to obtain at least one statement segment corresponding to the source code statement may include:

[0049] Identify source code sentences and determine the original encoding rules and sentence segmentation vocabulary corresponding to the source code sentences;

[0050] According to the original coding rules and the sentence segmentation vocabulary, the source code sentence is segmented to obtain at least one sentence fragment.

[0051] The sentence segmentation vocabulary may include multiple keywords and multiple operators corresponding to the original encoding rules.

[0052] In this implementation, the possible code statements can be segmented in advance according to the existing different coding rules (including the programming language used) to obtain the corresponding keyword groups (including at least one keyword) and operators. So that the statement segmentation module can segment the source code statements with the statement segmentation library. Different coding rules can be set up with different statement segmentation thesaurus, and the corresponding statement segmentation thesaurus can be determined according to the original coding rules (including the programming language used) used to write the source code statements, and then the source code statements can be segmented.

[0053] In a possible implementation, sending at least one statement fragment to the pattern translation module 12 may include: sending at least one statement fragment to the pattern translation module 12 in sequence according to the order in which each statement fragment appears in the source code statement.

[0054] In this implementation, at least one statement fragment can be sent to the pattern translation module 12 in sequence according to a preset sequence of appearance of the statement fragments in the source code sentence from front to back or from back to front. In this way, the pattern translation module can determine the sequence of appearance of different statement fragments in the source code sentence according to the sequence of receiving the statement fragments.

[0055] In a possible implementation, after receiving the sentence fragments sent in sequence by the sentence segmentation module, the pattern translation module can translate the received sentence fragments in sequence to obtain at least one intermediate code fragment. In this way, the position of the corresponding sentence fragment in the source code statement can be determined according to the translation order corresponding to the intermediate code fragment.

[0056] In one possible implementation, the pattern translation module can send the intermediate code fragments to the statement splicing module in sequence according to the order in which the statement fragments are translated, so that the statement splicing module can determine the position of the corresponding statement fragment in the source code statement, its role in describing the processing operation (corresponding to the source code statement) and other fragment information according to the order in which the intermediate code fragments are received, so as to facilitate the statement splicing module to perform statement splicing on at least one intermediate code fragment based on the fragment information to obtain the target code statement.

[0057] For example, assuming that the source code statement is segmented into statement fragment 1, statement fragment 2 and statement fragment 3, and the corresponding appearance order is statement fragment 1 first, statement fragment 2 second, and statement fragment 3 last, the statement segmentation module can send statement fragment 1, statement fragment 2 and statement fragment 3 to the pattern translation module in sequence. The pattern translation module translates statement fragment 1, statement fragment 2 and statement fragment 3 in sequence to obtain the corresponding intermediate code fragment 1 (corresponding to statement fragment 1), intermediate code fragment 2 (corresponding to statement fragment 2), and intermediate code fragment 3 (corresponding to statement fragment 3). Then, the pattern translation module sends the intermediate code fragment 1, intermediate code fragment 2, and intermediate code fragment 3 to the statement splicing module in sequence. The statement splicing module determines the fragment information according to the receiving order of the intermediate code fragment 1, intermediate code fragment 2, and intermediate code fragment 3, and performs statement splicing to obtain the target code statement.

[0058] In a possible implementation, translating at least one received statement fragment according to a target encoding rule corresponding to the device to obtain at least one intermediate code fragment includes:

[0059] According to the target encoding rules and the content of the sentence fragment, a translation scheme corresponding to the sentence fragment is determined from a translation scheme library;

[0060] Translate the statement fragment according to the corresponding translation scheme to obtain the intermediate code fragment corresponding to the statement fragment.

[0061] The translation scheme library may include translation schemes corresponding to keywords in the keyword group and translation schemes corresponding to operators.

[0062] In this implementation, the translation schemes of keywords and operators in the statement fragments can be determined in advance according to the correspondence between different compilation rules. For example, the translation scheme of the operator "+" is set from JAVA language to C++ language, Windows language, Unix language, Android language, etc. In this way, it can be ensured that the target code statement obtained after the intermediate code fragments are spliced ​​can be executed by the device.

[0063] In a possible implementation, translating the statement fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the statement fragment may include at least one of the following:

[0064] Translate the key words in the sentence fragment according to the corresponding translation scheme to obtain the translated key words;

[0065] Translate the operators in the statement fragment according to the corresponding translation scheme to obtain the translated operators.

[0066] Wherein, at least one intermediate code fragment includes at least one of a translated keyword group, a translated operator and a variable name.

[0067] In this implementation, the variable names can be translated to obtain translated keyword groups. Since the variable names are set according to the user's choice in different code statements and do not have a unified regular rule, only the keyword groups and operators can be translated, and the variable names can retain their names in the source code statements. In this way, only the keyword groups and operators are translated, which can reduce the amount of operations required for translation and improve the speed of translation.

[0068] In a possible implementation, the keyword group in the sentence fragment is translated according to the corresponding translation scheme to obtain the translated keyword group, including:

[0069] When it is determined that the keyword group includes a designated symbol and the keyword group includes multiple keywords, the multiple keywords are translated in sequence according to the priority rules and corresponding translation schemes corresponding to the designated symbol to obtain a translated keyword group, which includes multiple translated keywords.

[0070] In this implementation, the designated symbol may include symbols such as "()", "{}", etc. that can change the execution order of the code, and the present disclosure does not limit this. For example, assuming that the designated symbol "{}" is included in the keyword group, the keywords in the "{}" in the keyword group can be preferentially translated, and then the keywords outside the "{}" can be translated. In this way, according to the order of the translated keywords, the execution order of the processing corresponding to the keyword in the processing operation represented by the keyword group, the order relationship between the processing and other processing, etc. can be determined, which is convenient for subsequent statement splicing to obtain the target code statement.

[0071] Figure 2 A block diagram of a code compatibility processing device according to an embodiment of the present disclosure is shown. In a possible implementation, Figure 2 As shown, the device may further include a code execution module 14. The code execution module 14 is used to execute target code statements.

[0072] In one possible implementation, Figure 2 As shown, the device may further include a code compiling module 15. The code compiling module 15 is used to compile the target code statement according to the target radix corresponding to the device before executing the target code statement.

[0073] In this implementation, after the device transforms the source code statement to obtain the target code statement, it can be directly executed in the device or sent to the corresponding execution device for execution, which is not limited by the present disclosure. The target base system can be binary, hexadecimal, etc., which is not limited by the present disclosure.

[0074] It should be noted that although the code compatibility processing device is introduced as an example using the above embodiment, those skilled in the art will appreciate that the present disclosure should not be limited thereto. In fact, users can flexibly set each module according to personal preferences and / or actual application scenarios, as long as they comply with the technical solutions provided by the present disclosure.

[0075] The present disclosure provides a machine learning computing device, which may include one or more of the above-mentioned code compatibility processing devices, which are used to obtain source code statements and control information from other processing devices and perform specified machine learning operations. The machine learning computing device can obtain code compatibility from other machine learning computing devices or non-machine learning computing devices, and pass the execution results to peripheral devices (also referred to as other processing devices) through an I / O interface. Peripheral devices include cameras, displays, mice, keyboards, network cards, wifi interfaces, and servers. When more than one code compatibility processing device is included, the code compatibility processing devices can be linked and data can be transmitted through a specific structure, for example, interconnected and data can be transmitted through a PCIE bus to support larger-scale neural network operations. At this time, the same control system can be shared, or each independent control system can be provided; memory can be shared, or each accelerator can have its own memory. In addition, the interconnection method can be any interconnection topology.

[0076] The machine learning computing device has high compatibility and can be connected to various types of servers through a PCIE interface.

[0077] Figure 3a FIG. 2 is a block diagram of a combined processing device according to an embodiment of the present disclosure. Figure 3a As shown, the combined processing device includes the above-mentioned machine learning computing device, a universal interconnection interface and other processing devices. The machine learning computing device interacts with other processing devices to jointly complete the operation specified by the user.

[0078] Other processing devices include one or more types of processors such as central processing unit (CPU), graphics processing unit (GPU), neural network processor, and other general / special processors. There is no limit on the number of processors included in other processing devices. Other processing devices serve as interfaces between the machine learning computing device and external data and control, including data handling, to complete basic control of the machine learning computing device such as starting and stopping; other processing devices can also collaborate with the machine learning computing device to complete computing tasks.

[0079] A universal interconnect interface is used to transmit data and control instructions between the machine learning computing device and other processing devices. The machine learning computing device obtains the required input data from other processing devices and writes it into the storage device on the machine learning computing device chip; it can obtain control instructions from other processing devices and write them into the control cache on the machine learning computing device chip; it can also read data in the storage module of the machine learning computing device and transmit it to other processing devices.

[0080] Figure 3b FIG. 1 is a block diagram of a combined processing device according to an embodiment of the present disclosure. In a possible implementation, Figure 3b As shown, the combined processing device may also include a storage device, which is connected to the machine learning operation device and the other processing device respectively. The storage device is used to store data in the machine learning operation device and the other processing device, and is particularly suitable for data that cannot be fully stored in the internal storage of the machine learning operation device or other processing devices.

[0081] The combined processing device can be used as a SOC chip system for mobile phones, robots, drones, video surveillance equipment and other devices, effectively reducing the core area of ​​the control part, improving the processing speed, and reducing the overall power consumption. In this case, the universal interconnection interface of the combined processing device is connected to certain components of the device. Certain components include cameras, displays, mice, keyboards, network cards, and wifi interfaces.

[0082] The present disclosure provides a machine learning chip, which includes the above-mentioned machine learning operation device or combined processing device.

[0083] The present disclosure provides a machine learning chip packaging structure, which includes the above-mentioned machine learning chip.

[0084] The present disclosure provides a board card. Figure 4 FIG. 2 shows a schematic diagram of the structure of a board according to an embodiment of the present disclosure. Figure 4 As shown, the board includes the above-mentioned machine learning chip packaging structure or the above-mentioned machine learning chip. In addition to the machine learning chip 389, the board may also include other supporting components, including but not limited to: a storage device 390, an interface device 391 and a control device 392.

[0085] The memory device 390 is connected to the machine learning chip 389 (or the machine learning chip in the machine learning chip package structure) via a bus for storing data. The memory device 390 may include multiple groups of storage units 393. Each group of storage units 393 is connected to the machine learning chip 389 via a bus. It is understood that each group of storage units 393 may be DDR SDRAM (English: Double Data Rate SDRAM, double rate synchronous dynamic random access memory).

[0086] DDR can double the speed of SDRAM without increasing the clock frequency. DDR allows data to be read on both the rising and falling edges of the clock pulse. DDR is twice as fast as standard SDRAM.

[0087] In one embodiment, the storage device 390 may include 4 groups of storage units 393. Each group of storage units 393 may include multiple DDR4 particles (chips). In one embodiment, the machine learning chip 389 may include 4 72-bit DDR4 controllers, 64 bits of the above 72-bit DDR4 controllers are used to transmit data, and 8 bits are used for ECC verification. It can be understood that when DDR4-3200 particles are used in each group of storage units 393, the theoretical bandwidth of data transmission can reach 25600MB / s.

[0088] In one embodiment, each group of storage units 393 includes a plurality of double rate synchronous dynamic random access memories arranged in parallel. DDR can transmit data twice in one clock cycle. A controller for controlling DDR is provided in the machine learning chip 389 to control the data transmission and data storage of each storage unit 393.

[0089] The interface device 391 is electrically connected to the machine learning chip 389 (or the machine learning chip in the machine learning chip packaging structure). The interface device 391 is used to realize data transmission between the machine learning chip 389 and an external device (such as a server or a computer). For example, in one embodiment, the interface device 391 can be a standard PCIE interface. For example, the data to be processed is transmitted from the server to the machine learning chip 289 through the standard PCIE interface to realize data transfer. Preferably, when the PCIE 3.0X 16 interface is used for transmission, the theoretical bandwidth can reach 16000MB / s. In another embodiment, the interface device 391 can also be other interfaces. The present disclosure does not limit the specific forms of expression of the above-mentioned other interfaces. The interface device can realize the switching function. In addition, the calculation results of the machine learning chip are still transmitted back to the external device (such as a server) by the interface device.

[0090] The control device 392 is electrically connected to the machine learning chip 389. The control device 392 is used to monitor the state of the machine learning chip 389. Specifically, the machine learning chip 389 and the control device 392 can be electrically connected through an SPI interface. The control device 392 may include a single-chip microcomputer (Micro Controller Unit, MCU). For example, the machine learning chip 389 may include multiple processing chips, multiple processing cores or multiple processing circuits, which can drive multiple loads. Therefore, the machine learning chip 389 can be in different working states such as multi-load and light load. The control device can be used to control the working states of multiple processing chips, multiple processing and / or multiple processing circuits in the machine learning chip.

[0091] The present disclosure provides a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned code compatibility processing method is implemented.

[0092] The present disclosure provides an electronic device, which includes the above-mentioned machine learning chip or board.

[0093] Electronic devices may include data processing devices, robots, computers, printers, scanners, tablet computers, smart terminals, mobile phones, driving recorders, navigators, sensors, cameras, servers, cloud servers, cameras, camcorders, projectors, watches, headphones, mobile storage, wearable devices, vehicles, household appliances, and / or medical devices.

[0094] The means of transport may include an airplane, a ship and / or a vehicle. The household appliances may include a television, an air conditioner, a microwave oven, a refrigerator, an electric rice cooker, a humidifier, a washing machine, an electric light, a gas stove, and a range hood. The medical equipment may include an MRI, an ultrasound machine and / or an electrocardiograph.

[0095] Figure 5 A flowchart of a code compatibility processing method according to an embodiment of the present disclosure is shown. Figure 5 As shown, the method includes steps S31 to S33. The method is applied to the above-mentioned code compatibility processing device, computer system, etc., wherein the computer system includes a memory and a processor, the memory is used to store computer programs, and the processor is used to execute steps S31 to S33.

[0096] In step S31, the received source code sentence is segmented to obtain at least one sentence fragment corresponding to the source code sentence;

[0097] In step S32, at least one received sentence fragment is translated according to the target encoding rule corresponding to the device to obtain at least one intermediate code fragment;

[0098] In step S33, the at least one received intermediate code fragment is identified, and statements of the at least one intermediate code fragment are spliced ​​according to the target coding rule to obtain a target code statement.

[0099] The statement fragment may include at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to a source code statement.

[0100] In a possible implementation, segmenting the received source code statement to obtain at least one statement segment corresponding to the source code statement may include:

[0101] Identify source code sentences and determine the original encoding rules and sentence segmentation vocabulary corresponding to the source code sentences;

[0102] According to the original coding rule and the sentence segmentation vocabulary, the source code sentence is segmented to obtain at least one sentence fragment, wherein the sentence segmentation vocabulary includes a plurality of keywords and a plurality of operators corresponding to the original coding rule.

[0103] In a possible implementation, the method may include: issuing at least one statement fragment in sequence according to the order in which each statement fragment appears in the source code statement.

[0104] In a possible implementation, translating the received at least one statement fragment according to the target coding rule corresponding to the method to obtain at least one intermediate code fragment may include:

[0105] According to the target encoding rules and the content of the sentence fragment, a translation scheme corresponding to the sentence fragment is determined from a translation scheme library;

[0106] Translate the statement fragment according to the corresponding translation scheme to obtain the intermediate code fragment corresponding to the statement fragment.

[0107] The translation scheme library includes translation schemes corresponding to keywords in the keyword group and translation schemes corresponding to operators.

[0108] In a possible implementation, translating the statement fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the statement fragment may include at least one of the following:

[0109] Translate the key words in the sentence fragment according to the corresponding translation scheme to obtain the translated key words;

[0110] Translate the operators in the statement fragment according to the corresponding translation scheme to obtain the translated operators.

[0111] The at least one intermediate code segment may include at least one of a translated keyword group, a translated operator, and a variable name.

[0112] In a possible implementation, translating the keyword group in the sentence fragment according to the corresponding translation scheme to obtain the translated keyword group may include:

[0113] When it is determined that the keyword group includes a designated symbol and the keyword group includes multiple keywords, the multiple keywords are translated in sequence according to the priority rules and corresponding translation schemes corresponding to the designated symbol to obtain a translated keyword group, which includes multiple translated keywords.

[0114] In a possible implementation, the method may further include: executing the target code statement.

[0115] In a possible implementation, the method may further include: before executing the target code statement, compiling the target code statement according to a target base system corresponding to the device.

[0116] It should be noted that, although the code compatibility processing method is introduced as above by taking the above embodiment as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each step according to personal preferences and / or actual application scenarios, as long as it complies with the technical solution provided by the present disclosure.

[0117] The code compatibility processing method provided in the embodiment of the present disclosure is applied between the underlying operating system and the application program, plays the role of bridging and unifying the application program and the system platform, is applicable to various platform environments, is not limited by the programming language used in the source code statements, has a wide range of applications and a fast processing speed, and improves the scalability and reusability of the source code statements.

[0118] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should know that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0119] It should be further explained that although Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 5At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0120] It should be understood that the above-mentioned device embodiments are only illustrative, and the device disclosed herein may also be implemented in other ways. For example, the division of units / modules described in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components may be combined, or may be integrated into another system, or some features may be ignored or not executed.

[0121] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present disclosure may be integrated into one unit / module, or each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0122] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the memory may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory RRAM (Resistive Random Access Memory), dynamic random access memory DRAM (Dynamic Random Access Memory), static random access memory SRAM (Static Random-Access Memory), enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), high-bandwidth memory HBM (High-Bandwidth Memory), hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0123] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution disclosed herein is essentially or partly contributed to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0124] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0125] The foregoing content can be better understood in accordance with the following terms:

[0126] Clause A1. A code compatibility processing device, comprising: a statement segmentation module, a pattern translation module and a statement splicing module,

[0127] The sentence segmentation module is used to segment the received source code sentence to obtain at least one sentence fragment corresponding to the source code sentence, and send the at least one sentence fragment to the pattern translation module;

[0128] The pattern translation module is used to translate the at least one sentence fragment received according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, and send the at least one intermediate code fragment to the sentence splicing module;

[0129] The statement splicing module is used to identify the at least one intermediate code fragment received, perform statement splicing on the at least one intermediate code fragment according to the target coding rule, and obtain a target code statement.

[0130] The statement fragment includes at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to the source code statement.

[0131] Clause A2. The apparatus according to claim Clause A1, segmenting the received source code statement to obtain at least one statement fragment corresponding to the source code statement, comprising:

[0132] Identify the source code sentence and determine the original encoding rule and sentence segmentation vocabulary corresponding to the source code sentence;

[0133] Segment the source code sentence according to the original coding rule and the sentence segmentation vocabulary to obtain the at least one sentence fragment,

[0134] The sentence segmentation vocabulary includes multiple keywords and multiple operators corresponding to the original encoding rules.

[0135] Clause A3. The apparatus according to claim clause A1, sending the at least one sentence fragment to the pattern translation module, comprising:

[0136] The at least one statement fragment is sent to the pattern translation module in sequence according to the order in which each statement fragment appears in the source code statement.

[0137] Clause A4. The apparatus according to claim Clause A1, translating the received at least one statement fragment according to a target encoding rule corresponding to the apparatus to obtain at least one intermediate code fragment, comprising:

[0138] Determining a translation scheme corresponding to the sentence fragment from a translation scheme library according to the target encoding rule and the content of the sentence fragment;

[0139] The sentence fragment is translated according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the sentence fragment.

[0140] The translation scheme library includes translation schemes corresponding to the keywords in the keyword group and translation schemes corresponding to the operators.

[0141] Clause A5. The apparatus according to claim Clause A1 or Clause A4 translates the statement fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the statement fragment, including at least one of the following:

[0142] Translate the key words in the sentence fragment according to the corresponding translation scheme to obtain the translated key words;

[0143] Translate the operators in the statement fragment according to the corresponding translation scheme to obtain the translated operators.

[0144] The at least one intermediate code fragment includes at least one of the translated keyword group, the translated operator and the variable name.

[0145] Clause A6. The apparatus according to claim A5, wherein the key words in the sentence fragment are translated according to the corresponding translation scheme to obtain the translated key words, including:

[0146] When it is determined that the keyword group includes a designated symbol and the keyword group includes multiple keywords, the multiple keywords are translated in sequence according to the priority rules and corresponding translation schemes corresponding to the designated symbol to obtain a translated keyword group, which includes multiple translated keywords.

[0147] Clause A7. The apparatus according to claim Clause A1, further comprising:

[0148] The code execution module is used to execute the target code statement.

[0149] Clause A8. The apparatus according to claim A7, further comprising:

[0150] A code compiling module is used to compile the target code statement according to a target radix corresponding to the device before running the target code statement.

[0151] Clause A9. A machine learning computing device, the device comprising:

[0152] One or more code compatibility processing devices as described in any one of clauses A1 to A8, used to obtain source code statements and control information from other processing devices, and perform specified machine learning operations, and transmit the execution results to other processing devices through an I / O interface;

[0153] When the machine learning computing device includes a plurality of the code compatibility processing devices, the plurality of the code compatibility processing devices may be connected and transmit data through a specific structure;

[0154] Among them, multiple code compatibility processing devices are interconnected and transmit data through a fast peripheral device interconnection bus PCIE bus to support larger-scale machine learning operations; multiple code compatibility processing devices share the same control system or have their own control systems; multiple code compatibility processing devices share memory or have their own memory; the interconnection method of multiple code compatibility processing devices is any interconnection topology.

[0155] Clause A10. A combined processing device, the combined processing device comprising:

[0156] The machine learning computing device, universal interconnect interface and other processing devices as described in claim A9;

[0157] The machine learning computing device interacts with the other processing devices to jointly complete the computing operation specified by the user.

[0158] Among them, the combined processing device also includes: a storage device, which is connected to the machine learning operation device and the other processing devices respectively, and is used to store data of the machine learning operation device and the other processing devices.

[0159] Clause A11. A machine learning chip, the machine learning chip comprising:

[0160] A machine learning computing device as described in claim A9 or a combined processing device as described in claim 10.

[0161] Clause A12. An electronic device, comprising:

[0162] A machine learning chip as described in claim clause A11.

[0163] Clause A13. A board comprising: a storage device, an interface device, a control device, and a machine learning chip as claimed in claim A11;

[0164] Wherein, the machine learning chip is connected to the storage device, the control device and the interface device respectively;

[0165] The storage device is used to store data;

[0166] The interface device is used to realize data transmission between the machine learning chip and an external device;

[0167] The control device is used to monitor the status of the machine learning chip.

[0168] Clause A14. A code compatibility processing method, applied to a code compatibility processing device, the method comprising:

[0169] Segmenting the received source code sentence to obtain at least one sentence fragment corresponding to the source code sentence;

[0170] Translating the received at least one sentence fragment according to a target encoding rule corresponding to the device to obtain at least one intermediate code fragment;

[0171] Identify the at least one intermediate code fragment received, perform sentence splicing on the at least one intermediate code fragment according to the target coding rule to obtain a target code sentence,

[0172] The statement fragment includes at least one of a keyword group, a variable name and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to the source code statement.

[0173] Clause A15. The method according to claim Clause A14, segmenting the received source code statement to obtain at least one statement fragment corresponding to the source code statement, comprising:

[0174] Identify the source code sentence and determine the original encoding rule and sentence segmentation vocabulary corresponding to the source code sentence;

[0175] Segment the source code sentence according to the original coding rule and the sentence segmentation vocabulary to obtain the at least one sentence fragment,

[0176] The sentence segmentation vocabulary includes multiple keywords and multiple operators corresponding to the original encoding rules.

[0177] Clause A16. The method according to claim clause A14, the method further comprising:

[0178] The at least one statement fragment is emitted in sequence according to the order in which each statement fragment appears in the source code statement.

[0179] Clause A17. The method according to claim Clause A14, wherein the at least one received statement fragment is translated according to a target coding rule corresponding to the method to obtain at least one intermediate code fragment, including:

[0180] Determining a translation scheme corresponding to the sentence fragment from a translation scheme library according to the target encoding rule and the content of the sentence fragment;

[0181] The sentence fragment is translated according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the sentence fragment.

[0182] The translation scheme library includes translation schemes corresponding to the keywords in the keyword group and translation schemes corresponding to the operators.

[0183] Clause A18. According to the method of claim A14 or A17, the statement fragment is translated according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the statement fragment, including at least one of the following:

[0184] Translate the key words in the sentence fragment according to the corresponding translation scheme to obtain the translated key words;

[0185] Translate the operators in the statement fragment according to the corresponding translation scheme to obtain the translated operators.

[0186] The at least one intermediate code fragment includes at least one of the translated keyword group, the translated operator and the variable name.

[0187] Clause A19. The method according to claim clause A18, wherein the keyword group in the sentence fragment is translated according to the corresponding translation scheme to obtain the translated keyword group, including:

[0188] When it is determined that the keyword group includes a designated symbol and the keyword group includes multiple keywords, the multiple keywords are translated in sequence according to the priority rules and corresponding translation schemes corresponding to the designated symbol to obtain a translated keyword group, which includes multiple translated keywords.

[0189] Clause A20. The method according to claim clause A14, the method further comprising:

[0190] Execute the target code statement.

[0191] Clause A21. The method according to claim clause A20, the method further comprising:

[0192] Before executing the target code statement, the target code statement is compiled according to a target base corresponding to the device.

[0193] The embodiments of the present disclosure are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present disclosure. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present disclosure, the specific implementation methods and the scope of application of the present disclosure, all belong to the scope of protection of the present disclosure. In summary, the content of this specification should not be understood as a limitation on the present disclosure.

Claims

1. A code compatibility processing device, characterized in that: The device comprises: a sentence segmentation module, a pattern translation module and a sentence splicing module. The statement segmentation module is used to segment the received source code statement to obtain at least one statement fragment corresponding to the source code statement, and send the at least one statement fragment to the pattern translation module in the order in which the statement fragments appear in the source code statement; The pattern translation module is used to translate the received at least one statement fragment according to the order in which the statement fragments appear in the source code statement and according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, and send the at least one intermediate code fragment to the statement splicing module according to the order in which the statement fragments appear in the source code statement; The statement splicing module is used to identify the at least one intermediate code fragment received, perform statement splicing on the at least one intermediate code fragment according to the target coding rule, and obtain a target code statement. The statement fragment includes at least one of a keyword group, a variable name, and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to the source code statement; The method comprises: translating the at least one received sentence fragment according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, including: determining a translation scheme corresponding to the sentence fragment from a translation scheme library according to the target coding rule and the content of the sentence fragment; translating the sentence fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the sentence fragment, wherein the translation scheme library includes a translation scheme corresponding to a keyword in the keyword group and a translation scheme corresponding to the operator; The step of translating the sentence fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the sentence fragment includes at least one of the following: translating a keyword group in the sentence fragment according to the corresponding translation scheme to obtain a translated keyword group; translating an operator in the sentence fragment according to the corresponding translation scheme to obtain a translated operator, wherein the at least one intermediate code fragment includes at least one of the translated keyword group, the translated operator and the variable name; Among them, the keyword group in the sentence fragment is translated according to the corresponding translation scheme to obtain the translated keyword group, including: when it is determined that the keyword group includes a specified symbol and the keyword group includes multiple keywords, according to the priority rules corresponding to the specified symbol and the corresponding translation scheme, the multiple keywords are translated in sequence to obtain the translated keyword group, and the translated keyword group includes multiple translated keywords.

2. The device according to claim 1, characterized in that Segmenting the received source code sentence to obtain at least one sentence fragment corresponding to the source code sentence includes: Identify the source code sentence and determine the original encoding rule and sentence segmentation vocabulary corresponding to the source code sentence; Segment the source code sentence according to the original coding rule and the sentence segmentation vocabulary to obtain the at least one sentence fragment, The sentence segmentation vocabulary includes multiple keywords and multiple operators corresponding to the original encoding rules.

3. The device according to claim 1, characterized in that The device also includes: The code execution module is used to execute the target code statement.

4. The device according to claim 3, characterized in that The device also includes: A code compiling module is used to compile the target code statement according to a target radix corresponding to the device before running the target code statement.

5. A machine learning computing device, characterized in that: The device comprises: One or more code compatibility processing devices according to any one of claims 1 to 4, used to obtain source code statements, data to be calculated and control information from other processing devices, and perform specified machine learning operations, and transmit the execution results to other processing devices through I / O interfaces; When the machine learning computing device includes a plurality of the code compatibility processing devices, the plurality of the code compatibility processing devices may be connected and transmit data through a specific structure; Among them, multiple code compatibility processing devices are interconnected and transmit data through a fast peripheral device interconnection bus PCIE bus to support larger-scale machine learning operations; multiple code compatibility processing devices share the same control system or have their own control systems; multiple code compatibility processing devices share memory or have their own memory; the interconnection method of multiple code compatibility processing devices is any interconnection topology.

6. A combined processing device, characterized in that: The combined processing device comprises: The machine learning computing device, universal interconnect interface and other processing devices as claimed in claim 5; The machine learning computing device interacts with the other processing devices to jointly complete the computing operation specified by the user. Among them, the combined processing device also includes: a storage device, which is connected to the machine learning operation device and the other processing devices respectively, and is used to store data of the machine learning operation device and the other processing devices.

7. A machine learning chip, characterized in that: The machine learning chip includes: The machine learning operation device as claimed in claim 5 or the combined processing device as claimed in claim 6.

8. An electronic device, characterized in that: The electronic device comprises: The machine learning chip as described in claim 7.

9. A board, characterized in that: The board includes: a storage device, an interface device, a control device and a machine learning chip as claimed in claim 7; Wherein, the machine learning chip is connected to the storage device, the control device and the interface device respectively; The storage device is used to store data; The interface device is used to realize data transmission between the machine learning chip and an external device; The control device is used to monitor the status of the machine learning chip.

10. A code compatibility processing method, characterized in that: Applied to a code compatibility processing device, the method comprises: Segmenting the received source code statement to obtain at least one statement fragment corresponding to the source code statement, and sequentially issuing the at least one statement fragment according to the order in which the statement fragments appear in the source code statement; According to the order in which each of the statement fragments appears in the source code statement, the received at least one statement fragment is translated according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment; Identifying the at least one intermediate code fragment received in the order in which the statement fragments appear in the source code statement, performing statement splicing on the at least one intermediate code fragment according to the target coding rule to obtain a target code statement, The statement fragment includes at least one of a keyword group, a variable name, and an operator, the keyword group includes at least one keyword, and the keyword group is used to indicate a processing operation corresponding to the source code statement; The method comprises: translating the at least one received sentence fragment according to the target coding rule corresponding to the device to obtain at least one intermediate code fragment, including: determining a translation scheme corresponding to the sentence fragment from a translation scheme library according to the target coding rule and the content of the sentence fragment; translating the sentence fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the sentence fragment, wherein the translation scheme library includes a translation scheme corresponding to a keyword in the keyword group and a translation scheme corresponding to the operator; The step of translating the sentence fragment according to the corresponding translation scheme to obtain an intermediate code fragment corresponding to the sentence fragment includes at least one of the following: translating a keyword group in the sentence fragment according to the corresponding translation scheme to obtain a translated keyword group; translating an operator in the sentence fragment according to the corresponding translation scheme to obtain a translated operator, wherein the at least one intermediate code fragment includes at least one of the translated keyword group, the translated operator and the variable name; Among them, the keyword group in the sentence fragment is translated according to the corresponding translation scheme to obtain the translated keyword group, including: when it is determined that the keyword group includes a specified symbol and the keyword group includes multiple keywords, according to the priority rules corresponding to the specified symbol and the corresponding translation scheme, the multiple keywords are translated in sequence to obtain the translated keyword group, and the translated keyword group includes multiple translated keywords.

11. The method according to claim 10, characterized in that Segmenting the received source code sentence to obtain at least one sentence fragment corresponding to the source code sentence includes: Identify the source code sentence and determine the original encoding rule and sentence segmentation vocabulary corresponding to the source code sentence; Segment the source code sentence according to the original coding rule and the sentence segmentation vocabulary to obtain the at least one sentence fragment, The sentence segmentation vocabulary includes multiple keywords and multiple operators corresponding to the original encoding rules.

12. The method according to claim 10, characterized in that The method further comprises: Execute the target code statement.

13. The method according to claim 12, characterized in that The method further comprises: Before executing the target code statement, the target code statement is compiled according to a target base corresponding to the device.

14. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 10 to 13 is implemented.