Instruction block aggregation method and device, computer equipment and storage medium

By obtaining the instruction association relationship between the initial instruction blocks, determining the instruction blocks to be aggregated and performing aggregation, the problems of low encapsulation efficiency and high labor cost in the prior art are solved, and the reuse and system of the API interface are realized The combination of calls improves aggregation efficiency and flexibility.

CN119211286APending Publication Date: 2024-12-27CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411236418.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The prior art is difficult to find a balance between taking into account the reusability of API interfaces and the complexity of system calls, resulting in low encapsulation and aggregation efficiency of instruction blocks and high labor costs.

Method used

By obtaining the instruction association relationship between the initial instruction blocks, the first instruction block and the second instruction block to be aggregated are determined, and the instruction block aggregation is performed, the granularity of the encapsulated instruction interface is dynamically set, and the API interface reuse and system calls are realized. Take into account both.

Benefits of technology

Improves the efficiency of instruction block aggregation, reduces labor costs, and improves the reusability and flexibility of interface packaging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119211286A_ABST
    Figure CN119211286A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of core networks, in particular to an instruction block aggregation method and device, computer equipment and a storage medium. The method comprises the steps of obtaining at least one initial instruction block; determining a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block from each initial instruction block according to an instruction association relationship between the initial instruction blocks; and performing instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block. According to the method and the device, the initial instruction block is aggregated into the target instruction block, and the granularity of the packaged instruction interface is dynamically set, so that the adjusted granularity of the instruction interface gives consideration to the reusability of an API (Application Program Interface) and the complexity of system calling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of core network technology, and in particular to an instruction block aggregation method, apparatus, computer equipment and storage medium. Background Art

[0002] To support the activation of upper-layer services, the new generation of cloud network operation service system encapsulates instructions as API (Application Programming Interface) capabilities for the orchestration system to call. By calling the API capabilities, instructions are issued to network elements to activate services.

[0003] For APIs with too large granularity, if all instructions that need to be issued by the same type of network elements are encapsulated into one API, the complexity of orchestration system calls and the interaction time can be reduced, but it is difficult to reuse for different business scenarios. If a large-granularity API is split into multiple small-granularity APIs, although it can reduce the workload of IT's repeated API development and improve the reuse of atomic capabilities, it will also increase the call pressure of the orchestration system, increase the system interaction time and the complexity of business activation.

[0004] Therefore, how to aggregate instruction blocks so that each instruction block can be encapsulated into an independent interface and reasonably set the granularity of the encapsulated instruction interface to achieve both the reuse of the API interface and the complexity of the system call has become a key issue for rapid service launch. Summary of the invention

[0005] Based on this, it is necessary to provide an instruction block aggregation method, device, computer equipment and storage medium that can aggregate instruction blocks so that each instruction block can be encapsulated into an independent interface, thereby realizing reasonable setting of the granularity of the encapsulated instruction interface.

[0006] In a first aspect, the present application provides an instruction block aggregation method. The method comprises:

[0007] Obtaining at least one initial instruction block;

[0008] Determining, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to the instruction association relationship between the initial instruction blocks;

[0009] The first instruction block and the corresponding second instruction block are aggregated to obtain a target instruction block.

[0010] In one embodiment, determining the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each of the initial instruction blocks according to the instruction association relationship between the initial instruction blocks includes:

[0011] For each of the initial instruction blocks, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block except the initial instruction block;

[0012] If it is determined that there is a target instruction association relationship that meets the aggregation condition in each of the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0013] In one embodiment, the instruction association relationship includes an instruction gradient value; and the determining of the instruction association relationship between the first boundary instruction of the initial instruction block and the second boundary instruction of each initial instruction block except the initial instruction block includes:

[0014] For each second boundary instruction, determining a function label similarity and an associated confidence between the first boundary instruction and the second boundary instruction;

[0015] An instruction gradient value between the first boundary instruction and the second boundary instruction is determined according to the association confidence and the function label similarity.

[0016] In one embodiment, determining the function label similarity between the first boundary instruction and the second boundary instruction includes:

[0017] Determine a first function label corresponding to the first boundary instruction and a second function label corresponding to the second boundary instruction;

[0018] A label similarity operation is performed on the first function label and the second function label to obtain a function label similarity between the first boundary instruction and the second boundary instruction.

[0019] In one embodiment, determining that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships includes:

[0020] If there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

[0021] In one embodiment, obtaining at least one initial instruction block includes:

[0022] Get the pending instruction template;

[0023] According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is segmented to obtain at least one initial instruction block.

[0024] In a second aspect, the present application also provides an instruction block aggregation device. The device comprises:

[0025] An acquisition module, used for acquiring at least one initial instruction block;

[0026] A determination module, configured to determine, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to an instruction association relationship between the initial instruction blocks;

[0027] The aggregation module is used to perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block.

[0028] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0029] Obtaining at least one initial instruction block;

[0030] Determining, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to the instruction association relationship between the initial instruction blocks;

[0031] The first instruction block and the corresponding second instruction block are aggregated to obtain a target instruction block.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0033] Obtaining at least one initial instruction block;

[0034] Determining, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to the instruction association relationship between the initial instruction blocks;

[0035] The first instruction block and the corresponding second instruction block are aggregated to obtain a target instruction block.

[0036] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0037] Obtaining at least one initial instruction block;

[0038] Determining, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to the instruction association relationship between the initial instruction blocks;

[0039] The first instruction block and the corresponding second instruction block are aggregated to obtain a target instruction block.

[0040] The above-mentioned instruction block aggregation method, device, computer equipment and storage medium obtain at least one initial instruction block and determine the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block based on the instruction association relationship between the initial instruction blocks, and then perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block. According to the above content, it can be known that in the process of setting the granularity of the encapsulated instruction interface, the present application can obtain the instruction association relationship between each initial instruction block to determine whether the two initial instruction blocks meet the aggregation conditions, and then use the two initial instruction blocks that meet the aggregation conditions as the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block, and then perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block, so as to achieve the dynamic setting of the encapsulated instruction interface granularity by aggregating the initial instruction blocks into the target instruction block, so that the adjusted instruction interface granularity takes into account the reuse of the API interface and the complexity of the system call; and, the present application determines the first instruction block to be aggregated and the second instruction corresponding to the first instruction block from each initial instruction block according to the instruction association relationship between each initial instruction block, compared with the process of manually implementing instruction combing in the prior art, which can not only effectively improve the efficiency of instruction block aggregation, but also reduce the labor cost required for combing instructions, and improve the reuse and flexibility of interface encapsulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] FIG1 is an application environment diagram of an instruction block aggregation method provided in an embodiment of the present application;

[0042] FIG2 is a schematic diagram of a flow chart of a first instruction block aggregation method provided in an embodiment of the present application;

[0043] FIG3 is a schematic diagram of a flow chart of a second instruction block aggregation method provided in an embodiment of the present application;

[0044] FIG4 is a schematic diagram of a flow chart of a third instruction block aggregation method provided in an embodiment of the present application;

[0045] FIG5 is a schematic diagram of a flow chart of a fourth instruction block aggregation method provided in an embodiment of the present application;

[0046] FIG6 is a structural block diagram of an instruction block aggregation device provided in an embodiment of the present application;

[0047] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In the description of the present application, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily have to be directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradicting each other.

[0050] The instruction block aggregation method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. By obtaining at least one initial instruction block, and according to the instruction association relationship between each initial instruction block, the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block are determined from each initial instruction block, and then, the first instruction block and the corresponding second instruction block are aggregated to obtain the target instruction block. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0051] In one embodiment, as shown in FIG. 2 , a method for aggregating instruction blocks is provided, and the method is applied to the terminal 102 in FIG. 1 as an example for description, including the following steps:

[0052] S201, obtaining at least one initial instruction block.

[0053] It should be noted that when at least one initial instruction block needs to be obtained, a to-be-processed instruction template including at least one initial instruction block may be obtained in advance, and then the to-be-processed instruction template may be split into instruction blocks to obtain at least one initial instruction block.

[0054] In one embodiment of the present application, an instruction segmentation module can be pre-trained, and then, after obtaining a to-be-processed instruction template containing at least one initial instruction block, the to-be-processed instruction template is input into the instruction segmentation module, so that the instruction segmentation module can split the instruction template into instruction blocks according to the function labels corresponding to the initial instruction blocks in the to-be-processed instruction template to obtain at least one initial instruction block.

[0055] Among them, the training process of the instruction segmentation module may include the following contents: obtaining at least one sample instruction template, and annotating each sample instruction block and the sample function label corresponding to each sample instruction block in each sample instruction template through manual labeling, and then, training the initial segmentation model through each sample instruction template annotated with the sample instruction block and the sample function label to obtain the trained instruction segmentation module.

[0056] S202: Determine, from each initial instruction block, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to an instruction association relationship between each initial instruction block.

[0057] It should be noted that the instruction association relationship between the initial instruction blocks is used to characterize the instruction association relationship between the boundary instructions corresponding to the initial instruction blocks. Therefore, when it is necessary to determine the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from the initial instruction blocks, it is necessary to determine the instruction association relationship between the initial instruction blocks in advance, and then determine the first instruction block and the second instruction block based on the instruction association relationship between the initial instruction blocks.

[0058] Further explanation: when it is necessary to determine the instruction association relationship between each initial instruction block, the association confidence and function label similarity between the boundary instructions corresponding to each initial instruction block can be obtained, and then, based on the association confidence and function label similarity, the instruction association relationship between each initial instruction block can be determined.

[0059] It is further explained that when it is necessary to determine the instruction association relationship between each initial instruction block, the association confidence and function label similarity between the boundary instructions corresponding to each initial instruction block can also be obtained, and then, based on the association confidence and function label similarity, the instruction gradient value between the boundary instructions corresponding to each initial instruction block is determined, and based on the instruction gradient value between the boundary instructions corresponding to each initial instruction block, the instruction association relationship between each initial instruction block is determined.

[0060] In one embodiment of the present application, when it is necessary to determine whether an initial instruction block belongs to the first instruction block, it can be determined whether there is a target instruction association relationship that meets the aggregation conditions in each instruction association relationship based on the instruction association relationship between the initial instruction blocks. If it is determined that there is a target instruction association relationship that meets the aggregation conditions in each instruction association relationship, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0061] S203, performing instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block.

[0062] In one embodiment of the present application, when it is necessary to perform instruction block aggregation on a first instruction block and a corresponding second instruction block, an instruction aggregation module can be pre-trained, and then the first instruction block and the second instruction block can be input into the instruction aggregation module to obtain a target instruction block output by the instruction aggregation module.

[0063] Among them, the training process of the instruction aggregation module includes: pre-acquiring at least one sample first instruction block and a sample second instruction block corresponding to each sample first instruction block, manually aggregating each sample first instruction block and the sample second instruction block corresponding to each sample first instruction block to obtain an aggregated sample target module, and performing model training on the initial aggregation module through the sample first instruction block, the sample second instruction block corresponding to each sample first instruction block and each target module to obtain a trained instruction aggregation module.

[0064] The above-mentioned instruction block aggregation method obtains at least one initial instruction block, and determines the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block based on the instruction association relationship between the initial instruction blocks, and then performs instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block. According to the above content, it can be known that in the process of setting the granularity of the encapsulated instruction interface, the present application can obtain the instruction association relationship between each initial instruction block to determine whether the two initial instruction blocks meet the aggregation conditions, and then use the two initial instruction blocks that meet the aggregation conditions as the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block, and then perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block, so as to achieve the dynamic setting of the encapsulated instruction interface granularity by aggregating the initial instruction blocks into the target instruction block, so that the adjusted instruction interface granularity takes into account the reuse of the API interface and the complexity of the system call; and, the present application determines the first instruction block to be aggregated and the second instruction corresponding to the first instruction block from each initial instruction block according to the instruction association relationship between each initial instruction block, compared with the process of manually implementing instruction combing in the prior art, which can not only effectively improve the efficiency of instruction block aggregation, but also reduce the labor cost required for combing instructions, and improve the reuse and flexibility of interface encapsulation.

[0065] In one embodiment, as shown in FIG3 , when it is necessary to determine the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block according to the instruction association relationship between the initial instruction blocks, the following contents may be specifically included:

[0066] S301, for each initial instruction block, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block except the initial instruction block.

[0067] It should be noted that in order to ensure that the first instruction block and the second instruction block determined subsequently can be smoothly aggregated into the target instruction block, it is necessary to ensure that the instruction association relationship between the first boundary instruction of the first instruction block and the second boundary instruction of the second instruction block meets the aggregation conditions. Therefore, in order to ensure the smooth progress of the subsequent process, it is necessary to determine the first boundary instruction of the initial instruction block and the instruction association relationship between the second boundary instruction of each initial instruction block except the initial instruction block.

[0068] S302: If it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0069] Among them, if the instruction association relationship between two initial instruction blocks meets the aggregation condition, it indicates that the two initial instruction blocks can be aggregated into a target instruction block; further, the aggregation condition can be set or adjusted according to the actual situation and the historical experience of the operation and maintenance personnel, and the specific content of the aggregation condition is not limited here.

[0070] It should be noted that, in order to more intuitively characterize the instruction association relationship between the initial instruction blocks, the instruction gradient value can be used to characterize the instruction association relationship, wherein the instruction gradient value is used to measure the degree of association between the boundary instructions of the initial instruction blocks; the higher the instruction gradient value, the higher the degree of association between the boundary instructions of the two initial instruction blocks; the lower the instruction gradient value, the lower the degree of association between the boundary instructions of the two initial instruction blocks; therefore, in the case where the instruction association relationship includes the instruction gradient value, when it is necessary to determine the instruction association relationship between the first boundary instruction of the initial instruction block and the second boundary instruction of each initial instruction block except the initial instruction block, it may include the following content: for each second boundary instruction, determine the function label similarity and the association confidence between the first boundary instruction and the second boundary instruction; and then, determine the instruction gradient value between the first boundary instruction and the second boundary instruction based on the association confidence and the function label similarity.

[0071] To further illustrate, when it is necessary to determine the function label similarity between the first boundary instruction and the second boundary instruction, the following contents may be included: determining the first function label corresponding to the first boundary instruction, and the second function label corresponding to the second boundary instruction; performing label similarity operation on the first function label and the second function label to obtain the function label similarity between the first boundary instruction and the second boundary instruction.

[0072] Therefore, when determining whether there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, if there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

[0073] The target instruction association relationship is an instruction association relationship including an instruction gradient value greater than the instruction gradient value.

[0074] In one embodiment of the present application, when it is necessary to determine the instruction gradient value between the first boundary instruction and the second boundary instruction, the first boundary instruction and the second boundary instruction can be substituted into calculation formula (1), and then, the instruction gradient value between the first boundary instruction and the second boundary instruction can be determined according to calculation formula (1).

[0075] The calculation formula (1) is as follows:

[0076] (1)

[0077] Among them, j refers to the functional label similarity between the first boundary instruction and the second boundary instruction, and c refers to the association confidence between the first boundary instruction and the second boundary instruction; a and b are preset coefficient weights, and 0 < a < 1, 0 < b < 1, and a + b = 1.

[0078] Furthermore, when it is necessary to determine the functional label similarity between the first boundary instruction and the second boundary instruction, the first functional label corresponding to the first boundary instruction and the second functional label corresponding to the second boundary instruction can be substituted into the calculation formula (2). Furthermore, the functional label similarity between the first boundary instruction and the second boundary instruction can be determined according to the calculation formula (2).

[0079] The calculation formula (2) is as follows:

[0080] (2)

[0081] Among them, L1 refers to the first functional label corresponding to the first boundary instruction, L2 refers to the second functional label corresponding to the second boundary instruction, and j refers to the functional label similarity between the first boundary instruction and the second boundary instruction.

[0082] Furthermore, when it is necessary to determine the association confidence between the first boundary instruction and the second boundary instruction, the conditional probability that when the first boundary instruction is displayed in the instruction template to be processed, the next adjacent instruction is the second boundary instruction can be determined. Furthermore, the association confidence between the first boundary instruction and the second boundary instruction can be determined according to the conditional probability.

[0083] The determination of the association confidence between the first boundary instruction and the second boundary instruction can be as shown in the calculation formula (3):

[0084] (3)

[0085] Among them, c refers to the association confidence between the first boundary instruction and the second boundary instruction, Command1 refers to the first boundary instruction, Command2 refers to the second boundary instruction, and P refers to the conditional probability that when the first boundary instruction is displayed in the instruction template to be processed, the next adjacent instruction is the second boundary instruction.

[0086] The above-mentioned instruction block aggregation method determines the instruction association relationship between the first boundary instruction of the initial instruction block and the second boundary instruction of each initial instruction block except the initial instruction block. When it is determined that there is a target instruction association relationship that meets the aggregation conditions in each instruction association relationship, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block; and provides a data basis for the subsequent process of performing instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block, so as to achieve the dynamic setting of the encapsulation instruction interface granularity by aggregating the initial instruction blocks into target instruction blocks, so that the adjusted instruction interface granularity takes into account the reuse of the API interface and the complexity of the system call.

[0087] In one embodiment, as shown in FIG4 , when it is necessary to obtain at least one initial instruction block, the specific steps may be as follows:

[0088] S401, obtaining a to-be-processed instruction template.

[0089] The to-be-processed instruction template records at least one initial instruction block and function labels corresponding to each initial instruction block.

[0090] Specifically, the instruction template to be processed may include but is not limited to: instruction serial numbers corresponding to each initial instruction block, configuration items of the initial instruction block, configuration instruction content of the initial instruction block, function labels of the initial instruction block, etc.

[0091] S402: According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is divided into instructions to obtain at least one initial instruction block.

[0092] In one embodiment of the present application, an instruction segmentation module can be pre-trained, and then, after obtaining a to-be-processed instruction template containing at least one initial instruction block, the to-be-processed instruction template is input into the instruction segmentation module, so that the instruction segmentation module can split the instruction template to be processed into instruction blocks according to the function labels corresponding to each initial instruction block in the to-be-processed instruction template to obtain at least one initial instruction block.

[0093] The above-mentioned instruction block aggregation method, through at least one function tag contained in the instruction template to be processed, performs instruction segmentation on the instruction template to be processed to obtain at least one initial instruction block, which provides a data basis for subsequently determining the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block, and performing instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block, thereby ensuring the smooth progress of the subsequent process.

[0094] In one embodiment, as shown in FIG5 , when it is necessary to determine the target instruction block, the following contents may be specifically included:

[0095] S501, obtaining a to-be-processed instruction template.

[0096] S502: According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is segmented to obtain at least one initial instruction block.

[0097] S503: Determine a first function label corresponding to the first boundary instruction and a second function label corresponding to the second boundary instruction.

[0098] S504: Perform a label similarity operation on the first function label and the second function label to obtain the function label similarity between the first boundary instruction and the second boundary instruction.

[0099] S505: Determine the association confidence between the first function label and the second function label.

[0100] S506 , for each initial instruction block, determine an instruction gradient value between the first boundary instruction and the second boundary instruction according to the association confidence and the function label similarity.

[0101] S507, if it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0102] S508, performing instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block.

[0103] The above-mentioned instruction block aggregation method obtains at least one initial instruction block, and determines the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block based on the instruction association relationship between the initial instruction blocks, and then performs instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block. According to the above content, it can be known that in the process of setting the granularity of the encapsulated instruction interface, the present application can obtain the instruction association relationship between each initial instruction block to determine whether the two initial instruction blocks meet the aggregation conditions, and then use the two initial instruction blocks that meet the aggregation conditions as the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block, and then perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block, so as to achieve the dynamic setting of the encapsulated instruction interface granularity by aggregating the initial instruction blocks into the target instruction block, so that the adjusted instruction interface granularity takes into account the reuse of the API interface and the complexity of the system call; and, the present application determines the first instruction block to be aggregated and the second instruction corresponding to the first instruction block from each initial instruction block according to the instruction association relationship between each initial instruction block, compared with the process of manually implementing instruction combing in the prior art, which can not only effectively improve the efficiency of instruction block aggregation, but also reduce the labor cost required for combing instructions, and improve the reuse and flexibility of interface encapsulation.

[0104] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0105] Based on the same inventive concept, the embodiment of the present application also provides an instruction block aggregation device for implementing the instruction block aggregation method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in the one or more instruction block aggregation device embodiments provided below can refer to the limitations of the instruction block aggregation method above, and will not be repeated here.

[0106] In one embodiment, as shown in FIG6 , an instruction block aggregation device is provided, comprising: an acquisition module 10, a determination module 20 and an aggregation module 30, wherein:

[0107] The acquisition module 10 is used to acquire at least one initial instruction block.

[0108] The determination module 20 is used to determine the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block according to the instruction association relationship between each initial instruction block.

[0109] The aggregation module 30 is used to perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block.

[0110] In one embodiment, for each initial instruction block, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block other than the initial instruction block;

[0111] If it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0112] In one embodiment, for each second boundary instruction, determining the function label similarity between the first boundary instruction and the second boundary instruction, and the associated confidence;

[0113] An instruction gradient value between the first boundary instruction and the second boundary instruction is determined according to the association confidence and the function label similarity.

[0114] In one embodiment, determining a first function tag corresponding to a first boundary instruction and a second function tag corresponding to a second boundary instruction;

[0115] A label similarity operation is performed on the first function label and the second function label to obtain the function label similarity between the first boundary instruction and the second boundary instruction.

[0116] In one embodiment, if there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

[0117] In one embodiment, obtaining a to-be-processed instruction template;

[0118] According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is divided into instructions to obtain at least one initial instruction block.

[0119] The above-mentioned instruction block aggregation device obtains at least one initial instruction block and determines the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from each initial instruction block based on the instruction association relationship between the initial instruction blocks, and then performs instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block. According to the above content, it can be known that in the process of setting the granularity of the encapsulated instruction interface, the present application can obtain the instruction association relationship between each initial instruction block to determine whether the two initial instruction blocks meet the aggregation conditions, and then use the two initial instruction blocks that meet the aggregation conditions as the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block, and then perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain the target instruction block, so as to achieve the dynamic setting of the encapsulated instruction interface granularity by aggregating the initial instruction blocks into the target instruction block, so that the adjusted instruction interface granularity takes into account the reuse of the API interface and the complexity of the system call; and, the present application determines the first instruction block to be aggregated and the second instruction corresponding to the first instruction block from each initial instruction block according to the instruction association relationship between each initial instruction block, compared with the process of manually implementing instruction combing in the prior art, which can not only effectively improve the efficiency of instruction block aggregation, but also reduce the labor cost required for combing instructions, and improve the reuse and flexibility of interface encapsulation.

[0120] Each module in the above instruction block aggregation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0121] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an instruction block aggregation method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0122] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0123] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0124] Obtaining at least one initial instruction block;

[0125] According to the instruction association relationship between the initial instruction blocks, determining the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from the initial instruction blocks;

[0126] The first instruction block is aggregated with the corresponding second instruction block to obtain a target instruction block.

[0127] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0128] For each initial instruction block, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block other than the initial instruction block;

[0129] If it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0130] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0131] For each second boundary instruction, determining the function label similarity between the first boundary instruction and the second boundary instruction, and the associated confidence;

[0132] An instruction gradient value between the first boundary instruction and the second boundary instruction is determined according to the association confidence and the function label similarity.

[0133] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0134] Determine a first function label corresponding to the first boundary instruction and a second function label corresponding to the second boundary instruction;

[0135] A label similarity operation is performed on the first function label and the second function label to obtain the function label similarity between the first boundary instruction and the second boundary instruction.

[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0137] If there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0139] Get the pending instruction template;

[0140] According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is divided into instructions to obtain at least one initial instruction block.

[0141] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0142] Obtaining at least one initial instruction block;

[0143] According to the instruction association relationship between the initial instruction blocks, determining the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from the initial instruction blocks;

[0144] The first instruction block is aggregated with the corresponding second instruction block to obtain a target instruction block.

[0145] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0146] For each initial instruction block, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block other than the initial instruction block;

[0147] If it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0148] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0149] For each second boundary instruction, determining the function label similarity between the first boundary instruction and the second boundary instruction, and the associated confidence;

[0150] An instruction gradient value between the first boundary instruction and the second boundary instruction is determined according to the association confidence and the function label similarity.

[0151] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0152] Determine a first function label corresponding to the first boundary instruction and a second function label corresponding to the second boundary instruction;

[0153] A label similarity operation is performed on the first function label and the second function label to obtain the function label similarity between the first boundary instruction and the second boundary instruction.

[0154] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0155] If there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0157] Get the pending instruction template;

[0158] According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is divided into instructions to obtain at least one initial instruction block.

[0159] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0160] Obtaining at least one initial instruction block;

[0161] According to the instruction association relationship between the initial instruction blocks, determining the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block from the initial instruction blocks;

[0162] The first instruction block is aggregated with the corresponding second instruction block to obtain a target instruction block.

[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0164] For each initial instruction block, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block other than the initial instruction block;

[0165] If it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0167] For each second boundary instruction, determining the function label similarity between the first boundary instruction and the second boundary instruction, and the associated confidence;

[0168] An instruction gradient value between the first boundary instruction and the second boundary instruction is determined according to the association confidence and the function label similarity.

[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0170] Determine a first function label corresponding to the first boundary instruction and a second function label corresponding to the second boundary instruction;

[0171] A label similarity operation is performed on the first function label and the second function label to obtain the function label similarity between the first boundary instruction and the second boundary instruction.

[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0173] If there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0175] Get the pending instruction template;

[0176] According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is divided into instructions to obtain at least one initial instruction block.

[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0179] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are 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.

[0180] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for aggregating instruction blocks, characterized in that: The method comprises: Obtaining at least one initial instruction block; Determining, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to the instruction association relationship between the initial instruction blocks; The first instruction block and the corresponding second instruction block are aggregated to obtain a target instruction block.

2. The method according to claim 1, characterized in that The determining, from each of the initial instruction blocks, the first instruction block to be aggregated and the second instruction block corresponding to the first instruction block according to the instruction association relationship between the initial instruction blocks comprises: For each of the initial instruction blocks, determining an instruction association relationship between a first boundary instruction of the initial instruction block and a second boundary instruction of each initial instruction block except the initial instruction block; If it is determined that there is a target instruction association relationship that meets the aggregation condition in each of the instruction association relationships, the initial instruction block is used as the first instruction block, and the initial instruction block corresponding to the target instruction association relationship is used as the second instruction block corresponding to the first instruction block.

3. The method according to claim 2, characterized in that The instruction association relationship includes an instruction gradient value; the instruction association relationship between the first boundary instruction of the initial instruction block and the second boundary instruction of each initial instruction block except the initial instruction block includes: For each second boundary instruction, determining a function label similarity and an associated confidence between the first boundary instruction and the second boundary instruction; An instruction gradient value between the first boundary instruction and the second boundary instruction is determined according to the association confidence and the function label similarity.

4. The method according to claim 3, characterized in that The determining the function label similarity between the first boundary instruction and the second boundary instruction includes: Determine a first function label corresponding to the first boundary instruction and a second function label corresponding to the second boundary instruction; A label similarity operation is performed on the first function label and the second function label to obtain a function label similarity between the first boundary instruction and the second boundary instruction.

5. The method according to claim 3, characterized in that: The determining whether there is a target instruction association relationship satisfying the aggregation condition among the instruction association relationships includes: If there is an instruction gradient value greater than the instruction gradient value among the instruction gradient values, it is determined that there is a target instruction association relationship that meets the aggregation condition among the instruction association relationships.

6. The method according to any one of claims 1 to 5, characterized in that The obtaining of at least one initial instruction block comprises: Get the pending instruction template; According to at least one function tag included in the instruction template to be processed, the instruction template to be processed is segmented to obtain at least one initial instruction block.

7. An instruction block aggregation device, characterized in that: The device comprises: An acquisition module, used for acquiring at least one initial instruction block; A determination module, configured to determine, from each of the initial instruction blocks, a first instruction block to be aggregated and a second instruction block corresponding to the first instruction block according to an instruction association relationship between the initial instruction blocks; The aggregation module is used to perform instruction block aggregation on the first instruction block and the corresponding second instruction block to obtain a target instruction block.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.