Waveform analysis method and device, computer equipment, storage medium and program product
By analyzing the waveform indication information and generating hash values, finding out whether there is matching waveform data in the cache, the problem of repeated generation of data of the same waveform is solved, and resource saving and efficiency improvement are achieved.
Patent Information
- Application Number
- CN202510199391.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-05-13
AI Technical Summary
In the waveform generation task, the same waveform needs to be repeatedly generated waveform data, resulting in waste of resources.
By analyzing the waveform indication information, a target hash value is generated, and a matching waveform data is found in the cache. If present, read the data directly from the cache to avoid duplicate generation.
The computing resources occupied by generating waveform data are reduced and the generation efficiency of microwave pulses is improved.
Smart Images

Figure CN119987483A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a waveform analysis method, device, computer equipment, storage medium and program product. Background Art
[0002] In the field of computer technology, when the experimental equipment performs each waveform generation task, it needs to first obtain the waveform indication information, and then send the waveform indication information to the waveform analysis device, which generates waveform data based on the waveform expression and sends it to the waveform generator. The waveform generator can generate the corresponding microwave pulse based on the received waveform data.
[0003] However, since the same waveform may be generated in different waveform generation tasks, if the waveform analysis device generates waveform data every time and transmits it to the waveform generator, it will lead to a problem of resource waste. Summary of the invention
[0004] In view of this, the present invention provides a waveform analysis method, apparatus, computer equipment, storage medium and program product to solve the problem of resource waste.
[0005] In a first aspect, the present invention provides a waveform analysis method, which is executed by a target object and includes:
[0006] Obtain waveform indication information;
[0007] Parsing the waveform indication information to obtain node information of at least one node;
[0008] Generate a target hash value corresponding to the waveform indication information according to the node information of each node;
[0009] Determine whether waveform data corresponding to a target hash value exists in a cache of a target object, wherein the target object is a waveform parsing device or a waveform generating device;
[0010] When it is determined that waveform data corresponding to the target hash value exists in the cache and the target object is a waveform parsing device, the waveform data corresponding to the target hash value in the cache is sent to the wave generating device to generate a microwave pulse corresponding to the waveform indication information.
[0011] A waveform analysis method provided by the present invention has the following advantages:
[0012] When the waveform indication information is obtained, the waveform indication information is first parsed to obtain the node information of at least one node, and then a target hash value is generated according to the node information of each node, and it is determined whether there is waveform data matching the target hash value in the cache of the target object. If there is, there is no need to generate waveform data according to the node information of each node, but the waveform data matching the target hash value can be directly read from the cache, and the wave generating device can directly generate microwave pulses according to the waveform data. In this way, for the same waveform, there is no need to repeatedly generate waveform data, but the previously generated waveform data is used to generate microwave pulses, which can reduce the computing resources occupied by generating waveform data.
[0013] In an optional implementation, generating a target hash value corresponding to the waveform indication information according to the node information of each node includes:
[0014] Determine the node type of each node according to the node information of each node and the preset classification rules;
[0015] Determine the level of each node according to the node type and node information of each node;
[0016] A target hash value corresponding to the waveform indication information is generated according to the node information, node type, and level of each node.
[0017] Specifically, when two waveform indication information are different but the waveforms actually indicated are the same, if the waveform indication information is directly hashed as a whole to generate a hash value, the hash values corresponding to the two waveform indication information will be different, and waveform data still needs to be generated. This solution first determines the type of node through the node information and preset classification rules of the node, and then determines the level of the node according to the node type and node information of the node. Finally, the target hash value is generated by combining the node information, node type and level, which can ensure that equivalent waveform indication information can generate the same target hash value, reducing the problem of resource waste.
[0018] In an optional implementation, when the number of nodes includes multiple nodes, generating a target hash value corresponding to the waveform indication information according to the node information, node type, and level of each node includes:
[0019] When it is determined that the level of the first node is the lowest level according to the level of each node, a hash value corresponding to the first node is generated according to the node type and node information of the first node and a hash value generation rule corresponding to the node type of the first node, wherein the first node is any one of the multiple nodes;
[0020] or,
[0021] When it is determined according to the level of at least one node that the level of the first node is not the lowest level, extracting identification information of a node at a lower level corresponding to the first node and identification information of a first operator corresponding to the first node from the node information of the first node, wherein the node at a lower level in the at least one node is preferentially determined to determine the hash value;
[0022] Generate a hash value corresponding to the first node according to the identification information of the node at a lower level and the identification information of the first operator corresponding to the first node;
[0023] When the level of the first node is the highest level, the hash value corresponding to the first node is determined as the target hash value.
[0024] Specifically, by first determining and processing the lowest level nodes, and then gradually processing the higher level nodes, the order and logic of data processing are ensured. This bottom-up processing helps reduce redundant calculations and ensures that the hash value of each layer is based on the accurate results of the next layer.
[0025] In an optional implementation, the first node is a waveform type node, and the node information of the first node includes identification information of the first waveform function and at least one waveform parameter index value; according to the node type of the first node and the hash value generation rule corresponding to the node type of the first node, a hash value corresponding to the first node is generated, including:
[0026] Performing a hash calculation on the identification information of the first waveform function to obtain a hash value corresponding to the first waveform function;
[0027] Perform hash calculation on each waveform parameter index value to obtain a hash value corresponding to each waveform parameter index value;
[0028] A hash value corresponding to the first node is generated according to the hash value corresponding to the first waveform function and the hash value corresponding to each waveform parameter index value.
[0029] Specifically, by performing hash calculation and combination only on important parameters related to the waveform in the node information, the amount of data calculated can be reduced while ensuring the accuracy of the calculated hash value, that is, ensuring the uniqueness and non-tamperability of each component, which is more secure. In addition, the hash calculation of each part can be calculated in parallel, which can improve the efficiency of calculating the hash value.
[0030] In an optional implementation, determining the hash value corresponding to the first node according to the hash value corresponding to the waveform function and the hash value corresponding to each waveform parameter index value includes:
[0031] Constructing a first hash value sequence according to the hash value corresponding to the identification information of the waveform function and the hash value corresponding to each waveform parameter index value;
[0032] A hash calculation is performed on the first hash value sequence to obtain a hash value corresponding to the first node.
[0033] Specifically, by forming a first hash value sequence using a hash value corresponding to the identification information of the waveform function and a hash value corresponding to the waveform parameter index value, and then performing a hash calculation on the first hash value sequence, the security of the hash calculation can be improved.
[0034] In an optional implementation, the first node is an operator type node; generating a hash value corresponding to the first node according to identification information of a node at a lower level and identification information of a first operator corresponding to the first node includes:
[0035] Performing a hash calculation on the identification information of the first operator to obtain a hash value corresponding to the first operator;
[0036] According to the identification information of the node at the lower level, the hash value corresponding to the node at the lower level is matched;
[0037] A hash value corresponding to the first node is generated according to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level.
[0038] Specifically, by performing a hash calculation on the identification information of the first operator and combining it with the hash value of the lower-level node to generate the final hash value, security is higher. In addition, by combining the hash value of the operator with the hash value of the lower-level node to generate the final hash value, the overall consistency and integrity of the data are further enhanced, and the accuracy of the hash value calculation is guaranteed.
[0039] In an optional implementation, generating a hash value corresponding to the first node according to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level includes:
[0040] Constructing a second hash value sequence according to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level;
[0041] A hash calculation is performed on the second hash value sequence to obtain a hash value corresponding to the first node.
[0042] Specifically, by forming a second hash value sequence by using the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level, and then performing hash calculation on the second hash value sequence, the security of the hash calculation can be improved.
[0043] In an optional implementation, when the number of nodes includes multiple nodes, determining the level of each node according to the node type and node information of each node includes:
[0044] According to the node type of each node, determining a candidate node whose node type is an operator type from among the multiple nodes;
[0045] According to the identification information of the second operator included in the node information of the second node, obtaining the priority corresponding to the identification information of the second operator, wherein the second node is any candidate node;
[0046] The level of each node is determined according to the node information of each node and the priority corresponding to the identification information of the operator included in the node information of each candidate node.
[0047] Specifically, the level of each node is determined by the priority corresponding to the identification information of the operator and the node information of each node, which can ensure that the node information parsed from the equivalent waveform indication information can be sorted according to the same level, so that the same hash value can be obtained after the subsequent hash calculation of the equivalent waveform indication information, thereby reducing the problem of resource waste.
[0048] In an optional implementation, determining the node type of each node according to the node information of each node and a preset classification rule includes:
[0049] When the node information of the third node includes a numerical value, determining that the node type of the third node is a numerical type, wherein the third node is any one of the at least one node;
[0050] or,
[0051] When the node information of the third node includes waveform information, determining that the node information of the third node is of waveform type, wherein the waveform information includes identification information of a waveform function and at least one waveform parameter index value;
[0052] or,
[0053] When the node information of the third node includes identification information of the operator, it is determined that the node information of the third node is of the operator type.
[0054] Specifically, by checking the specific content of the node information (such as numerical value, waveform information or operator identification information), the type of the node can be accurately determined to ensure that each node is correctly classified.
[0055] In an optional implementation, the operator in the node information of each node includes one element of addition, subtraction, multiplication, division, unary minus, derivation, mixing, and conjugation, and the priority of the operator includes a first priority, a second priority, and a third priority;
[0056] The operators of the first priority include one or more of the following: unary minus, derivative, mixing, and conjugation;
[0057] Operators of the second priority level include one or more of the following: multiplication, division;
[0058] Operators of the third priority level include one or more of the following: addition, subtraction.
[0059] In an optional implementation, determining whether waveform data corresponding to the target hash value exists in the cache of the target object includes:
[0060] Determine whether there is a hash value consistent with the target hash value in the cache;
[0061] When it is determined that a hash value consistent with the target hash value exists in the cache, determining that waveform data corresponding to the target hash value exists in the cache of the target object;
[0062] or,
[0063] When it is determined that a hash value consistent with the target hash value does not exist in the cache, it is determined that waveform data corresponding to the target hash value exists in the cache of the target object.
[0064] Specifically, cache search by hash value greatly improves query efficiency. If waveform data consistent with the target hash value already exists in the cache, the data in the cache can be used directly without recalculation, saving computing resources and time.
[0065] In an optional embodiment, the method further includes:
[0066] When it is determined that waveform data corresponding to the target hash value exists in the cache and the target object is a wave generating device, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the target hash value.
[0067] Specifically, the wave generating device can obtain waveform data after processing the waveform indication information, and directly generate microwave pulses based on the waveform data. In this way, the resources occupied by transmitting waveform data between the waveform analyzing device and the wave generating device can be reduced, and the generation efficiency of microwave pulses can be improved.
[0068] In an optional implementation, when it is determined that the waveform data corresponding to the target hash value does not exist in the cache of the target object, the method further includes:
[0069] Extracting identification information of the waveform function from node information of at least one node;
[0070] According to the identification information of the waveform function, a waveform calculation method corresponding to the waveform function is obtained;
[0071] Generate target code according to the waveform calculation method corresponding to the waveform function, node information and level of each node;
[0072] Executing the target code to generate waveform data corresponding to the waveform indication information;
[0073] When the target object is a waveform analysis device, the waveform data corresponding to the waveform indication information is sent to the wave generating device to generate a microwave pulse corresponding to the waveform indication information.
[0074] Specifically, when there is no waveform data matching the waveform indication information in the cache, required waveform data may be generated to ensure normal generation of microwave pulses.
[0075] In an optional embodiment, the method further includes:
[0076] When the target object is a wave generating device, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the waveform indication information.
[0077] Specifically, the wave generating device can obtain waveform data after processing the waveform indication information, and directly generate microwave pulses based on the waveform data. In this way, the resources occupied by transmitting waveform data between the waveform analyzing device and the wave generating device can be reduced, and the generation efficiency of microwave pulses can be improved.
[0078] In an optional implementation, when the waveform parameter index value is a floating point number, a hash calculation is performed on each waveform parameter index value to obtain a hash value corresponding to each waveform parameter index value, including:
[0079] According to a preset hash precision and a target waveform parameter index value, a hash value corresponding to the target waveform parameter index value is determined, wherein the target waveform parameter index value is any one of the at least one waveform parameter index value.
[0080] Specifically, there is a problem of precision loss when floating-point numbers are stored in a computer. By setting the hash precision, the impact of this error on the hash value can be effectively reduced, ensuring that the generated hash value has high accuracy and consistency.
[0081] In an optional implementation, according to a preset hash precision and a target waveform parameter index value, a hash value corresponding to the target waveform parameter index value is determined using the following expression:
[0082] H = round (n / HASHERR)
[0083] Among them, H is the hash value corresponding to the target waveform parameter index value, n is the target waveform parameter index value, and HASHERR is the preset hash accuracy.
[0084] Specifically, by dividing by HASHERR and performing rounding operations, the floating-point number can be effectively adjusted to the required precision range, reducing the precision loss problem in floating-point number storage and calculation.
[0085] In a second aspect, the present invention provides a waveform analysis device, the waveform analysis device comprising:
[0086] An acquisition module, used for acquiring waveform indication information;
[0087] A parsing module, used for parsing the waveform indication information to obtain node information of at least one node;
[0088] A generating module, used for generating a target hash value corresponding to the waveform indication information according to the node information of each node;
[0089] A determination module, used to determine whether waveform data corresponding to a target hash value exists in a cache of a target object, wherein the target object is a waveform analysis device or a waveform generation device;
[0090] The sending module is used to send the waveform data corresponding to the target hash value in the cache to the wave generating device to generate a microwave pulse corresponding to the waveform indication information when it is determined that the waveform data corresponding to the target hash value exists in the cache and the target object is a waveform parsing device.
[0091] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the waveform analysis method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0092] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the waveform analysis method of the first aspect or any corresponding embodiment thereof.
[0093] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the waveform analysis method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0095] Figure 1 is a schematic diagram of the architecture of a computer system according to an embodiment of the present invention;
[0096] Figure 2 is a flow chart of a waveform analysis method according to an embodiment of the present invention;
[0097] Figure 3 is a flow chart of another waveform analysis method according to an embodiment of the present invention;
[0098] Figure 4 is a flow chart of another waveform analysis method according to an embodiment of the present invention;
[0099] Figure 5 is a schematic diagram of a node architecture of a computing tree according to an embodiment of the present invention;
[0100] Figure 6 is a structural block diagram of a waveform analysis device according to an embodiment of the present invention;
[0101] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0102] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0103] The embodiments of the present invention can be applied to computer systems such as Figure 1As shown, the computer system may include a wave parsing device, a wave generating device, and an experimental end computer. Among them, the wave parsing device and the wave generating device are both instrument-end devices. For example, the wave generating device may be an arbitrary wave generator (AWG). The experimental end is used to transmit the pre-built waveform indication information to the wave parser. The wave parser can be used to parse the received waveform indication information, obtain a hash value, and determine whether there is corresponding waveform data in the cache according to the hash value. When it is determined that there is corresponding waveform data, the waveform data is directly obtained and sent to the wave generating device, or, when it is determined that there is no corresponding waveform data, waveform data is generated according to the waveform indication information and sent to the wave generating device.
[0104] In some optional implementations, the computer system may also only include a wave generating device and an experimental end computer, and the experimental end computer is used to transmit the pre-constructed waveform indication information to the wave generating device. The wave generating device parses the waveform indication information to obtain a hash value, and determines whether there is corresponding waveform data in the cache according to the hash value, and generates a microwave pulse according to the waveform data when it is determined that there is corresponding waveform data, or generates waveform data according to the waveform indication information and then generates a microwave pulse when it is determined that there is no corresponding waveform data.
[0105] In the field of computer technology, quantum computing is a new computing technology with high computing efficiency. Currently, superconducting quantum bits are one of the mainstream routes to realize quantum computers. In the laboratory, the wave generating device usually generates relevant microwave pulses to drive the flipping and reading of quantum bits based on the waveform data obtained by its own analysis of waveform indication information, or the waveform data sent by the waveform analysis device, thereby realizing information transmission.
[0106] An embodiment of the present invention provides a waveform analysis method, which generates a hash value by analyzing and hashing waveform indication information, and searches the cache to see whether there is previously generated waveform data corresponding to the hash value. If so, there is no need to repeatedly generate the waveform data, but directly use the generated waveform data to generate microwave pulses, which can reduce resource waste and improve the generation efficiency of microwave pulses.
[0107] According to an embodiment of the present invention, a waveform analysis method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0108] In this embodiment, a waveform analysis method is provided, which can be performed by the above-mentioned waveform analysis device. Figure 2is a flow chart of a waveform analysis method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0109] Step S201, obtaining waveform indication information.
[0110] Among them, the waveform indication information may include a waveform expression, etc. The waveform expression may be expressed as "`wave name`[`parameter list`]", "`wave name`" represents the identification information of the waveform function, and [`parameter list`] includes at least one waveform parameter index value. The identification information of the waveform function may be the name of the waveform function. The waveform parameter index value may be the start time, time length, amplitude, frequency, phase, etc., and may also be other parameter index values customized by technical personnel. For example, "Gaussian[0.8, 0.5, 1.0, 0.0, 0.0]'+Rect[3.0, 2, 0.5, 0.0, 1.0]<<2", Gaussian represents Gaussian wave, [0.8, 0.5, 1.0, 0.0, 0.0] represents the waveform parameter index value of Gaussian wave, Rect represents rectangular wave, and [3.0, 2, 0.5, 0.0, 1.0] represents the waveform parameter index value of rectangular wave. The waveform parameter index value may be a floating point type, an integer or a complex number, etc.
[0111] Specifically, the technician can construct waveform indication information on the experimental end computer, and the experimental end computer sends the waveform indication information to the waveform analysis device. Since the amount of waveform data (information such as waveform amplitude at multiple time points, or information such as waveform amplitude at multiple frequencies) is large, if the waveform data is directly generated by the experimental end computer according to the waveform indication information and sent to the waveform analysis device, it will occupy more network resources. This solution sends the waveform indication information to the waveform analysis device, and the waveform indication information has a smaller amount of data than the waveform data, which can reduce the waste of network resources.
[0112] Step S202: parse the waveform indication information to obtain node information of at least one node.
[0113] Specifically, the waveform analysis device may analyze the waveform indication information according to a preset analysis rule to obtain node information of at least one node. For example, the preset analysis rule may be Shift Reduce.
[0114] Step S203: Generate a target hash value corresponding to the waveform indication information according to the node information of each node.
[0115] The node type of the node may be a numerical type, a waveform type, an operator type, etc.
[0116] The node information of the numerical type includes a numerical value. The numerical value can be a floating point type, an integer, or a complex number. The node of the numerical type can be a coefficient node, a translation length node, etc.
[0117] The node information of the waveform type includes waveform information, and the waveform information includes identification information of the waveform function and at least one waveform parameter index value.
[0118] The node information of the operator type includes the identification information of the operator and the identification information of the child node. For example, the operator may include one element of addition (+), subtraction (-), multiplication (*), division ( / ), unary minus, derivative ('), mixing (@), and conjugation (#), and the priority of the operator may include a first priority, a second priority, and a third priority. The operators of the first priority include one or more of the following: unary minus, derivative, mixing, and conjugation. The operators of the second priority include one or more of the following: multiplication and division. The operators of the third priority include one or more of the following: addition and subtraction. The first priority to the third priority decreases in sequence.
[0119] Specifically, the target hash value can be calculated in the following ways:
[0120] Method 1
[0121] Step 1: Determine the node type of each node based on the node information of each node and the preset classification rules.
[0122] Specifically, when the node information of the third node includes a numerical value, the node type of the third node is determined to be a numerical type. The third node is any one of the at least one node. Alternatively, when the node information of the third node includes waveform information, the node information of the third node is determined to be a waveform type. Alternatively, when the node information of the third node includes identification information of an operator, the node information of the third node is determined to be an operator type.
[0123] Step 2: Determine the level of each node according to the node type and node information of each node.
[0124] Among them, step 2 may specifically include:
[0125] Step 1: According to the node type of each node, determine a candidate node whose node type is an operator type from among multiple nodes.
[0126] Step 2: According to the identification information of the second operator included in the node information of the second node, obtain the priority corresponding to the identification information of the second operator.
[0127] The second node is any candidate node.
[0128] Step 3: Determine the level of each node according to the node information of each node and the priority corresponding to the identification information of the operator included in the node information of each candidate node.
[0129] Specifically, a mapping relationship table between operator identification information and priority can be pre-stored in the waveform analysis device. For each operator type node, the waveform analysis device can determine the corresponding priority based on the operator identification information included in the node information of the node.
[0130] Then, the waveform analysis device determines the candidate node with the lowest priority according to the priority corresponding to the identification information of the operator included in each candidate node, and determines the level of the candidate node with the lowest priority as the highest, and then determines the node of the second highest level according to the content included in the node information of the candidate node with the lowest priority, and then determines the node of the second highest level according to the node information of the second highest level node, and so on, when all nodes that do not include child node information are determined, the level of the node that does not include child node information is determined to be the lowest. In this way, the levels of all nodes can be determined.
[0131] According to the content included in the node information of the node, the process of determining the level of the node may specifically include:
[0132] When the node information of a node includes the identification information of an operator, the node corresponding to the identification information of the operator can be determined as a node of the next level; or, when the node information of the candidate node with the lowest priority includes waveform information, the node corresponding to the waveform information can be determined as a node of the next level.
[0133] Step three: Generate a target hash value corresponding to the waveform indication information according to the node information, node type, and level of each node.
[0134] Specifically, the number of nodes determined according to the analysis of the waveform indication information may include one or more nodes. Therefore, according to the number of nodes, the processing may be divided into the following two cases.
[0135] In case 1, when the number of nodes includes multiple nodes, the waveform analysis device can generate a target hash value corresponding to the waveform indication information according to the following steps:
[0136] First, when the level of the first node is determined to be the lowest level according to the level of each node, a hash value corresponding to the first node is generated according to the node type and node information of the first node and a hash value generation rule corresponding to the node type of the first node.
[0137] The first node is any one of the multiple nodes.
[0138] Specifically, when the level of the first node is the lowest level, the first node can be a node of waveform type or a node of numerical type. When the first node is a node of numerical type, the waveform analysis device can perform hash calculation on the numerical value included in the node information of the first node according to a preset hash algorithm to obtain a hash value corresponding to the first node. Alternatively, when the first node is a node of waveform type, the node information of the first node includes identification information of the first waveform function and at least one waveform parameter index value. The waveform analysis device can perform hash calculation on the identification information of the first waveform function according to a preset hash algorithm to obtain a hash value corresponding to the first waveform function. Moreover, hash calculation is performed on each waveform parameter index value respectively to obtain a hash value corresponding to each waveform parameter index value. Finally, based on the hash value corresponding to the first waveform function and the hash value corresponding to each waveform parameter index value, a hash value corresponding to the first node is generated.
[0139] According to the hash value corresponding to the first waveform function and the hash value corresponding to each waveform parameter index value, generating the hash value corresponding to the first node may specifically include:
[0140] A first hash value sequence is formed according to the hash value corresponding to the identification information of the waveform function and the hash value corresponding to each waveform parameter index value. The first hash value sequence is hashed according to a preset hash algorithm to obtain a hash value corresponding to the first node.
[0141] Specifically, in the process of constructing the first hash value sequence, the hash value corresponding to the identification information of the first waveform function can be arranged in the first place, and the hash value corresponding to the waveform parameter index value can be arranged in sequence after the hash value corresponding to the identification information of the waveform function according to the arrangement order in the waveform information.
[0142] In some optional embodiments, when the waveform parameter index value is a floating point number, the waveform parsing device can determine the hash value corresponding to the target waveform parameter index value based on a preset hash precision and the target waveform parameter index value, wherein the target waveform parameter index value is any one of at least one waveform parameter index value.
[0143] For example, the following expression can be used:
[0144] H = round (n / HASHERR)
[0145] Among them, H is the hash value corresponding to the target waveform parameter index value, n is the target waveform parameter index value, and HASHERR is the preset hash accuracy, for example, it can be 1e-7.
[0146] In some optional implementations, a mapping relationship table of waveform function identification information and hash values may be pre-stored in the waveform analysis device. In the process of generating the hash value corresponding to the first node, the hash value corresponding to the identification information of the first waveform function may be directly searched in the mapping relationship table according to the identification information of the first waveform function. In this way, for the same waveform function, the hash value only needs to be pre-calculated once, which can save computing resources.
[0147] Second, when it is determined that the level of the first node is not the lowest level according to the level of at least one node, the identification information of the node at a lower level corresponding to the first node (that is, the above-mentioned child node) and the identification information of the first operator corresponding to the first node are extracted from the node information of the first node. Based on the identification information of the node at a lower level and the identification information of the first operator corresponding to the first node, a hash value corresponding to the first node is generated.
[0148] Specifically, when the level of the first node is not the lowest level, the first node is an operator type node. At this time, the waveform parsing device can extract the identification information of the node at the lower level corresponding to the first node and the identification information of the first operator corresponding to the first node from the node information of the first node. Then, the waveform parsing device can perform a hash calculation on the identification information of the first operator to obtain a hash value corresponding to the first operator. According to the identification information of the node at the lower level, the hash value corresponding to the node at the lower level is matched. According to the hash value corresponding to the first operator and the hash value corresponding to the node at the lower level, a hash value corresponding to the first node is generated. Among them, the hash value of the node at the lower level is calculated first, so that when calculating the hash value of the first node, the hash value of the node at the lower level can be obtained according to the identification information of the node at the lower level included in its node information, that is, the hash value corresponding to its child node is obtained.
[0149] According to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level, generating the hash value corresponding to the first node may specifically include:
[0150] A second hash value sequence is formed according to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level. The second hash value sequence is hashed according to a preset hash algorithm to obtain a hash value corresponding to the first node.
[0151] Specifically, in the process of constructing the second hash value sequence, the hash value corresponding to the first operator can be arranged in the first place, and the arrangement order of the hash values corresponding to the nodes at the lower level can be obtained. Then, according to the arrangement order of the hash values corresponding to the nodes at the lower level, the hash values corresponding to the nodes at the lower level can be arranged in sequence after the hash value corresponding to the first operator.
[0152] The order of hash values corresponding to nodes at a lower level can be determined in the following two ways:
[0153] First, according to the arrangement order of the identification information of the nodes of the first level in the node information of the first node, the arrangement order of the hash values corresponding to the nodes of the lower level is determined.
[0154] Second, for the target level (any level other than the highest level), when the target level includes multiple nodes, the waveform analysis device can determine the priority of each node of the target level (the priority of the node of the numerical type can be set to the lowest) according to the preset arrangement rules and the identification information of the operator or the identification information of the waveform function included in the node information corresponding to all the nodes of the target level. The preset arrangement rules include the priority corresponding to the identification information of each operator and the priority corresponding to the identification information of each waveform function. Furthermore, in the above process of generating the hash value corresponding to the first node according to the hash value corresponding to the first operator and the hash value corresponding to the node of the lower level, the waveform analysis device can arrange the hash values corresponding to the nodes of the lower level according to the priority of each node of the lower level, and obtain the arrangement order of the hash values corresponding to the nodes of the lower level. In this way, it can be ensured that equivalent waveform indication information can generate the same hash value, improve the probability of finding waveform data matching the target hash value in the cache, and reduce the problem of resource waste.
[0155] For example, "A+B" and "B+A", "A" and "B" are nodes at the same level, the priority of "A" is higher than the priority of B. In the process of generating the hash value sequence, the hash value corresponding to "A" is ranked before the hash value corresponding to "B". In this way, it can be guaranteed that the hash values generated for "A+B" and "B+A" are the same.
[0156] For another example, "@A+B" and "B+@A", "@" and "B" are at the same level, the priority of "@" is higher than the priority of "B", and the hash value corresponding to "@" is before the hash value corresponding to "B". In this way, it can be guaranteed that the hash values generated for "@A+B" and "B+@A" are the same.
[0157] In this way, hash values can be calculated separately for different types of nodes in the above manner. Since the hash values of nodes at lower levels are determined first, the nodes at the highest level are unique. Therefore, the hash value corresponding to the nodes at the highest level is the target hash value corresponding to the waveform indication information. That is, when the first node is determined to be the node at the highest level, that is, when the first node is determined to be the root node, the hash value corresponding to the first node can be determined as the target hash value.
[0158] In case 2, when the number of nodes is one, the node is a waveform type node or a numerical type node. You can refer to case 1 for the specific processing of hash calculation for waveform type nodes and numerical type nodes, which will not be repeated here.
[0159] In a second method, the waveform analysis device can input the node information of all nodes as a whole into a preset hash algorithm to obtain a target hash value.
[0160] Method three: The waveform analysis device can input the node information of each node into a preset hash algorithm to obtain a hash value corresponding to each node, and then arrange the hash values according to the level of each node to obtain a fourth hash value sequence, and finally, perform hash calculation on the fourth hash value sequence to obtain a target hash value. The arrangement of hash values at the same level can refer to the above-mentioned process of constructing the second hash value sequence.
[0161] Step S204: determine whether there is waveform data corresponding to the target hash value in the cache of the target object.
[0162] The waveform data may include time domain data and / or frequency domain data, etc.
[0163] Specifically, the waveform parsing device can determine whether there is a hash value consistent with the target hash value in the cache. When it is determined that there is a hash value consistent with the target hash value in the cache, it is determined that there is waveform data corresponding to the target hash value in the cache of the target object. Alternatively, when it is determined that there is no hash value consistent with the target hash value in the cache, it is determined that there is waveform data corresponding to the target hash value in the cache of the target object.
[0164] Step S205, when it is determined that the waveform data corresponding to the target hash value exists in the cache, the waveform parsing device sends the waveform data corresponding to the target hash value in the cache to the waveform generating device.
[0165] Specifically, when the waveform analysis device determines that waveform data corresponding to the target hash value exists in the cache, the waveform data corresponding to the target hash value can be read from the cache according to the target hash value and sent to the wave generation device. After receiving the waveform data, the wave generation device can generate microwave pulses according to the waveform data.
[0166] In some optional implementations, when it is determined that the waveform data corresponding to the target hash value does not exist in the cache of the target object, the following steps may also be performed:
[0167] Step 1: extract identification information of the waveform function from node information of at least one node.
[0168] Step 2: Obtain a waveform calculation method corresponding to the waveform function according to the identification information of the waveform function.
[0169] Step three, generating target code according to the waveform calculation method corresponding to the waveform function, the node information and the level of each node.
[0170] Step 4: execute the target code to generate waveform data corresponding to the waveform indication information.
[0171] Step five, sending the waveform data corresponding to the waveform indication information to the wave generating device, so that the wave generating device generates microwave pulses.
[0172] After the waveform data is generated, the waveform analysis device may store the target hash value and the waveform data in a corresponding manner in a cache for use in a subsequent process of querying the waveform data.
[0173] The first node and the third node mentioned above may be the same node.
[0174] The waveform analysis method provided in this embodiment, when waveform indication information is obtained, first analyzes the waveform indication information to obtain node information of at least one node, and then generates a target hash value based on the node information of each node, and determines whether there is waveform data matching the target hash value in the cache of the target object. If so, there is no need to generate waveform data based on the node information of each node, but the waveform data matching the target hash value can be directly read from the cache. In this way, for the same waveform, the waveform analysis device does not need to repeatedly generate waveform data, but sends the previously generated waveform data to the wave generation device to generate microwave pulses, which can reduce the computing resources occupied by generating waveform data.
[0175] In this embodiment, a waveform analysis method is provided, which can be performed by the above-mentioned wave generation device. Figure 3 is a flow chart of a waveform analysis method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0176] Step S301, obtaining waveform indication information.
[0177] Step S302: parse the waveform indication information to obtain node information of at least one node.
[0178] Step S303: Generate a target hash value corresponding to the waveform indication information according to the node information of each node.
[0179] Step S304: determine whether there is waveform data corresponding to the target hash value in the cache of the target object.
[0180] The specific processing of steps S301 to S304 can refer to the specific processing of steps S201 to S204, which will not be repeated here.
[0181] Step S305 : when it is determined that the waveform data corresponding to the target hash value exists in the cache, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the target hash value.
[0182] In some optional implementations, when it is determined that the waveform data corresponding to the target hash value does not exist in the cache of the target object, the following steps may also be performed:
[0183] Step 1: extract identification information of the waveform function from node information of at least one node.
[0184] Step 2: Obtain a waveform calculation method corresponding to the waveform function according to the identification information of the waveform function.
[0185] Step three, generating target code according to the waveform calculation method corresponding to the waveform function, the node information and the level of each node.
[0186] Step 4: execute the target code to generate waveform data corresponding to the waveform indication information.
[0187] Step five: generating a microwave pulse corresponding to the waveform indication information based on the waveform data corresponding to the waveform indication information.
[0188] The waveform analysis method provided in this embodiment, when waveform indication information is obtained, first analyzes the waveform indication information to obtain node information of at least one node, and then generates a target hash value based on the node information of each node, and determines whether there is waveform data matching the target hash value in the cache of the target object. If so, there is no need to generate waveform data based on the node information of each node, but the waveform data matching the target hash value can be directly read from the cache and microwave pulses can be generated. In this way, for the same waveform, the waveform analysis device does not need to repeatedly generate waveform data, but uses the previously generated waveform data to generate microwave pulses, which can reduce the computing resources occupied by generating waveform data.
[0189] The following is a detailed description of the process of generating microwave pulses using a specific example. Figure 4 shown.
[0190] In the preparation stage, first, the technician can preset commonly used waveform functions in the target object (the waveform analysis device or wave generation device mentioned above), and define operators for performing operations on the waveform function itself, as well as operators for performing operations between different waveform functions. Taking Python language as an example, each waveform function corresponds to a Python class, which inherits the same parent class, and defines operators in the parent class EnveBase to implement operations on the waveform function. Among them, operators for performing operations on the waveform function itself may include translation, derivation, mixing, conjugation, etc., and operators for performing operations between different waveform functions may include addition, subtraction, multiplication, division, etc. In addition, the EnveBase class also defines a method for generating waveform data.
[0191] Secondly, the target object may be installed with parsing software for parsing waveform indication information, and the parsing software may be constructed by the grammar parsing tool "lex+yacc". The parsing software may define a token corresponding to each operator, for example, the token corresponding to derivation is "DEREIV", the token corresponding to mixing is "MIX", and the token corresponding to conjugation is "CONJ". Moreover, the parsing software may define the correspondence between tokens and regular expressions, and regular expressions may be mathematical symbols corresponding to operators (for example, the above-mentioned "@"). In addition, the parsing software may also define the priority of each operator, for example, precedence = (('left', 'PLUS', 'MINUS'), ('left', 'TIMES', 'DIVIDE'), ('right', 'UMINUSENV', 'DERIV', 'MIX', 'CONJ')). And, define regular expressions containing floating point types and integer types.
[0192] In the parsing stage, the technician constructs the waveform indication information on the experimental end computer and transmits it to the target object. The target object can parse the waveform indication information through the shift-reduce in the parsing software to generate the computational tree EnveNode (node). EnveNode can have all or part of the attributes of "strval", "children", and "envdata". Among them, "strval" is used to indicate the string of the node, "children" is used to indicate the child nodes of the node (the child node is also a node that is one level lower than the level of the node and belongs to the node), and "envdata" is used to indicate the identification information and waveform parameter index value of the waveform function. In the parsing process, when the operator is parsed, the identification information of the operator can be obtained, and the identification information of the operator is used as "strval", and the expression involved in the operation (which may include the identification information of the operator or the identification information of the waveform function) is used as "children", and "envdata" can be set to "None". When the waveform information is parsed, the identification information of the waveform function can be obtained, and the identification information of the waveform function is used as "strval", and the identification information and waveform parameter index value of the waveform function are used as "envdata". When a numerical value is parsed, the numerical value can be determined as "strval".
[0193] After the calculation tree EnveNode is generated, the level of each EnveNode can be determined according to the specific processing in step S203, and the EnveNode can be arranged in each level according to the "strval" in the EnveNode and the preset arrangement rules. The preset arrangement rules can include the priority of each string, and the string includes the identification information of the operator and the identification information of the waveform function, so that equivalent waveform indication information has the same tree structure. The priority of the numerical value is the lowest.
[0194] For example, the waveform indication information may be Gaussian[0.8, 0.5, 1.0, 0.0, 0.0]'+Rect[3.0, 2, 0.5, 0.0, 1.0]<<2. After parsing and sorting the waveform indication information, the following may be obtained: Figure 5 The node architecture of the computation tree shown in FIG. 1 , correspondingly, the node information of each node of the computation tree can be arranged as follows:
[0195] 1. Root node (+):
[0196] Strval: “plus”
[0197] Children: [derivative node, left shift node]
[0198] envdata::None
[0199] 2.1 Derivation node ('):
[0200] Strval: "DERIV"
[0201] Children: [Gaussian Waveform Node]
[0202] Envdata: None
[0203] 2.2 Left shift node (<<):
[0204] strval: "left shift"
[0205] Children: [rectangular wave node]
[0206] Envdata: None
[0207] 3.1 Gaussian waveform node (Gaussian):
[0208] Strval: "Gaussian"
[0209] Envdata: {'name': 'Gaussian', 'params': [0.8, 0.5, 1.0, 0.0, 0.0]}
[0210] 3.2 Rectangular waveform node (Rect):
[0211] Strval: "Rect"
[0212] Envdata: {'name': 'Rect', 'params': [3.0, 2, 0.5, 0.0, 1.0]}
[0213] 3.3 Numerical nodes: 2.
[0214] The target object can call a preset hash algorithm to calculate the hash value of each node from low to high according to the node hierarchy, and the hash value of the root node is used to generate a target hash value corresponding to the waveform indication information.
[0215] For example, the target object can perform hash calculations on the hash values of the 3.1 Gaussian waveform node and the 3.2 rectangular waveform node in parallel. The target object can perform hash calculations on "Gaussian" to obtain hash value 1, perform hash calculations on each value in [0.8, 0.5, 1.0, 0.0, 0.0] to obtain hash values 2 to 6, and then compose hash value sequence 1 from hash values 1 to 6, perform hash calculations on hash value sequence 1, and obtain hash value 7, which is the hash value corresponding to the 3.1 Gaussian waveform node.
[0216] Similarly, the target object can perform hash calculation on "Rect" to obtain hash value 8, perform hash calculation on each value in [3.0, 2, 0.5, 0.0, 1.0] to obtain hash values 9 to 13, and then combine hash values 8 to 13 into hash value sequence 2, and perform hash calculation on hash value sequence 2 to obtain hash value 14. Hash value 14 is the hash value corresponding to the rectangular waveform node 3.2.
[0217] After the target object completes the hash calculation of the lowest level node (level 3), it can perform hash calculation on the next higher level node. The target object can perform hash calculation on "DERIV" to obtain hash value 15, and then combine hash value 15 with hash value 7 to obtain hash value sequence 3. After performing hash calculation on hash value sequence 3, hash value 16 is obtained, which is the hash value corresponding to the derivation node in 2.1.
[0218] The target object can hash "left shift" to get hash value 17, and hash value 18 for the value node "2". Then, hash value 17, hash value 14, and hash value 18 are combined to get hash value sequence 4. After hashing hash value sequence 4, hash value 19 is obtained. Hash value 19 is the hash value corresponding to the 2.2 left shift node.
[0219] Finally, the target object can perform hash calculation on "plus" to obtain hash value 20, combine hash value 20, hash value 16 and hash value 18 to obtain hash value sequence 5, and after hash calculation on hash value sequence 5, obtain hash value 21. Hash value 21 is the hash value corresponding to the root node, that is, the hash value corresponding to hash value 21 and the waveform indication information.
[0220] The target object can search its own cache to see whether there is waveform data matching the target hash value. If so, the corresponding waveform data can be directly obtained according to the target hash value to generate microwave pulses. If not, the EnveBase class can be called to generate waveform data according to the above-mentioned calculation tree. The specific process can be referred to the specific process of generating waveform data corresponding to the waveform indication information in step S205, which will not be repeated here.
[0221] In this embodiment, a waveform analysis device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0222] This embodiment provides a waveform analysis device, such as Figure 6 As shown, including:
[0223] An acquisition module 601 is used to acquire waveform indication information;
[0224] The parsing module 602 is used to parse the waveform indication information to obtain node information of at least one node;
[0225] A generating module 603, configured to generate a target hash value corresponding to the waveform indication information according to the node information of each node;
[0226] A determination module 604 is used to determine whether there is waveform data corresponding to the target hash value in the cache of the target object;
[0227] The sending module 605 is used to send the waveform data corresponding to the target hash value in the cache to the wave generating device to generate a microwave pulse corresponding to the waveform indication information when it is determined that the waveform data corresponding to the target hash value exists in the cache and the target object is a waveform parsing device.
[0228] In some optional implementations, the generating module 603 is specifically configured to:
[0229] Determine the node type of each node according to the node information of each node and the preset classification rules;
[0230] Determine the level of each node according to the node type and node information of each node;
[0231] A target hash value corresponding to the waveform indication information is generated according to the node information, node type, and level of each node.
[0232] In some optional implementations, when the number of nodes includes multiple nodes, the generating module 603 is specifically used to:
[0233] When it is determined that the level of the first node is the lowest level according to the level of each node, a hash value corresponding to the first node is generated according to the node type and node information of the first node and a hash value generation rule corresponding to the node type of the first node, wherein the first node is any one of the multiple nodes;
[0234] or,
[0235] When it is determined according to the level of at least one node that the level of the first node is not the lowest level, extracting identification information of a node at a lower level corresponding to the first node and identification information of a first operator corresponding to the first node from the node information of the first node, wherein the node at a lower level in the at least one node is preferentially determined to determine the hash value;
[0236] Generate a hash value corresponding to the first node according to the identification information of the node at a lower level and the identification information of the first operator corresponding to the first node;
[0237] When the level of the first node is the highest level, the hash value corresponding to the first node is determined as the target hash value.
[0238] In some optional implementations, the first node is a waveform type node, and the node information of the first node includes identification information of the first waveform function and at least one waveform parameter index value; the generating module 603 is specifically used to:
[0239] Performing a hash calculation on the identification information of the first waveform function to obtain a hash value corresponding to the first waveform function;
[0240] Perform hash calculation on each waveform parameter index value to obtain a hash value corresponding to each waveform parameter index value;
[0241] A hash value corresponding to the first node is generated according to the hash value corresponding to the first waveform function and the hash value corresponding to each waveform parameter index value.
[0242] In some optional implementations, the generating module 603 is specifically configured to:
[0243] Constructing a first hash value sequence according to the hash value corresponding to the identification information of the waveform function and the hash value corresponding to each waveform parameter index value;
[0244] A hash calculation is performed on the first hash value sequence to obtain a hash value corresponding to the first node.
[0245] In some optional implementations, the first node is an operator type node; the generating module 603 is specifically configured to:
[0246] Performing a hash calculation on the identification information of the first operator to obtain a hash value corresponding to the first operator;
[0247] According to the identification information of the node at the lower level, the hash value corresponding to the node at the lower level is matched;
[0248] A hash value corresponding to the first node is generated according to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level.
[0249] In some optional implementations, the generating module 603 is specifically configured to:
[0250] Constructing a second hash value sequence according to the hash value corresponding to the first operator and the hash value corresponding to the node at a lower level;
[0251] A hash calculation is performed on the second hash value sequence to obtain a hash value corresponding to the first node.
[0252] In some optional implementations, when the number of nodes includes multiple nodes, the generating module 603 is specifically used to:
[0253] According to the node type of each node, determining a candidate node whose node type is an operator type from among the multiple nodes;
[0254] According to the identification information of the second operator included in the node information of the second node, obtaining the priority corresponding to the identification information of the second operator, wherein the second node is any candidate node;
[0255] The level of each node is determined according to the node information of each node and the priority corresponding to the identification information of the operator included in the node information of each candidate node.
[0256] In some optional implementations, the generating module 603 is specifically configured to:
[0257] When the node information of the third node includes a numerical value, determining that the node type of the third node is a numerical type, wherein the third node is any one of the at least one node;
[0258] or,
[0259] When the node information of the third node includes waveform information, determining that the node information of the third node is of waveform type, wherein the waveform information includes identification information of a waveform function and at least one waveform parameter index value;
[0260] or,
[0261] When the node information of the third node includes identification information of the operator, it is determined that the node information of the third node is of the operator type.
[0262] In some optional implementations, the operator in the node information of each node includes one element of addition, subtraction, multiplication, division, unary minus, derivation, mixing, and conjugation, and the priority of the operator includes a first priority, a second priority, and a third priority;
[0263] The operators of the first priority include one or more of the following: unary minus, derivative, mixing, and conjugation;
[0264] Operators of the second priority level include one or more of the following: multiplication, division;
[0265] Operators of the third priority level include one or more of the following: addition, subtraction.
[0266] In some optional implementations, the determination module 604 is specifically configured to:
[0267] Determine whether there is a hash value consistent with the target hash value in the cache;
[0268] When it is determined that a hash value consistent with the target hash value exists in the cache, determining that waveform data corresponding to the target hash value exists in the cache of the target object;
[0269] or,
[0270] When it is determined that a hash value consistent with the target hash value does not exist in the cache, it is determined that waveform data corresponding to the target hash value exists in the cache of the target object.
[0271] In some optional implementations, the determination module 604 is further configured to:
[0272] When it is determined that waveform data corresponding to the target hash value exists in the cache and the target object is a wave generating device, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the target hash value.
[0273] In some optional implementations, the determination module 604 is further configured to:
[0274] When it is determined that the waveform data corresponding to the target hash value does not exist in the cache of the target object, extracting identification information of the waveform function from node information of at least one node;
[0275] According to the identification information of the waveform function, a waveform calculation method corresponding to the waveform function is obtained;
[0276] Generate target code according to the waveform calculation method corresponding to the waveform function, node information and level of each node;
[0277] Executing the target code to generate waveform data corresponding to the waveform indication information;
[0278] When the target object is a waveform analysis device, the waveform data corresponding to the waveform indication information is sent to the wave generating device to generate a microwave pulse corresponding to the waveform indication information.
[0279] In some optional implementations, the determination module 604 is further configured to:
[0280] When the target object is a wave generating device, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the waveform indication information.
[0281] In some optional implementations, when the waveform parameter index value is a floating point number, the generating module 603 is specifically used to:
[0282] According to a preset hash precision and a target waveform parameter index value, a hash value corresponding to the target waveform parameter index value is determined, wherein the target waveform parameter index value is any one of the at least one waveform parameter index value.
[0283] In some optional implementations, according to a preset hash precision and a target waveform parameter index value, a hash value corresponding to the target waveform parameter index value is determined using the following expression:
[0284] H = round (n / HASHERR)
[0285] Among them, H is the hash value corresponding to the target waveform parameter index value, n is the target waveform parameter index value, and HASHERR is the preset hash accuracy.
[0286] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0287] The waveform analysis device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0288] The embodiment of the present invention also provides a computer device having the above Figure 6 The waveform analysis device shown. The computer device can be the above-mentioned waveform analysis device, and can also be the above-mentioned wave generation device.
[0289] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7A processor 10 is taken as an example.
[0290] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0291] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0292] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0293] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0294] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0295] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0296] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0297] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A waveform analysis method, characterized in that: The method is performed by a target object, and the method includes: Obtain waveform indication information; Parsing the waveform indication information to obtain node information of at least one node; Generate a target hash value corresponding to the waveform indication information according to the node information of each node; Determining whether waveform data corresponding to the target hash value exists in a cache of the target object, wherein the target object is a waveform parsing device or a waveform generating device; When it is determined that waveform data corresponding to the target hash value exists in the cache and the target object is a waveform parsing device, the waveform data corresponding to the target hash value in the cache is sent to a wave generating device to generate a microwave pulse corresponding to the waveform indication information.
2. The method according to claim 1, characterized in that The step of generating a target hash value corresponding to the waveform indication information according to the node information of each node includes: Determine the node type of each of the nodes according to the node information of each of the nodes and a preset classification rule; Determining the level of each of the nodes according to the node type and node information of each of the nodes; A target hash value corresponding to the waveform indication information is generated according to the node information, node type, and level of each of the nodes.
3. The method according to claim 2, characterized in that When the number of the nodes includes multiple nodes, generating a target hash value corresponding to the waveform indication information according to the node information, node type, and level of each of the nodes includes: When it is determined that the level of the first node is the lowest level according to the level of each of the nodes, a hash value corresponding to the first node is generated according to the node type and node information of the first node and a hash value generation rule corresponding to the node type of the first node, wherein the first node is any one of the multiple nodes; or, When it is determined according to the level of at least one of the nodes that the level of the first node is not the lowest level, extracting identification information of a node at a lower level corresponding to the first node and identification information of a first operator corresponding to the first node from the node information of the first node, wherein the hash value is determined preferentially for the node at a lower level in the at least one node; Generate a hash value corresponding to the first node according to the identification information of the node at the lower level and the identification information of the first operator corresponding to the first node; When the level of the first node is the highest level, a hash value corresponding to the first node is determined as the target hash value.
4. The method according to claim 3, characterized in that The first node is a waveform type node, and the node information of the first node includes identification information of a first waveform function and at least one waveform parameter index value; the generating a hash value corresponding to the first node according to the node type of the first node and a hash value generating rule corresponding to the node type of the first node includes: Performing a hash calculation on the identification information of the first waveform function to obtain a hash value corresponding to the first waveform function; Performing hash calculation on each of the waveform parameter index values to obtain a hash value corresponding to each of the waveform parameter index values; A hash value corresponding to the first node is generated according to the hash value corresponding to the first waveform function and the hash value corresponding to each of the waveform parameter index values.
5. The method according to claim 4, characterized in that The determining, according to the hash value corresponding to the waveform function and the hash value corresponding to each of the waveform parameter index values, the hash value corresponding to the first node includes: Constructing a first hash value sequence according to the hash value corresponding to the identification information of the waveform function and the hash value corresponding to each of the waveform parameter index values; Perform a hash calculation on the first hash value sequence to obtain a hash value corresponding to the first node.
6. The method according to claim 3, characterized in that The first node is an operator type node; and generating a hash value corresponding to the first node according to the identification information of the node at the lower level and the identification information of the first operator corresponding to the first node includes: Performing a hash calculation on the identification information of the first operator to obtain a hash value corresponding to the first operator; According to the identification information of the node at the lower level, matching the hash value corresponding to the node at the lower level; A hash value corresponding to the first node is generated according to the hash value corresponding to the first operator and the hash value corresponding to the node at the lower level.
7. The method according to claim 6, characterized in that The step of generating a hash value corresponding to the first node according to the hash value corresponding to the first operator and the hash value corresponding to the node at the lower level includes: Constructing a second hash value sequence according to the hash value corresponding to the first operator and the hash value corresponding to the node at the lower level; Perform a hash calculation on the second hash value sequence to obtain a hash value corresponding to the first node.
8. The method according to any one of claims 2 to 7, characterized in that: When the number of the nodes includes multiple nodes, determining the level of each node according to the node type and node information of each node includes: According to the node type of each of the nodes, determining a candidate node whose node type is an operator type among the multiple nodes; According to the identification information of the second operator included in the node information of the second node, acquiring the priority corresponding to the identification information of the second operator, wherein the second node is any one of the candidate nodes; The level of each of the nodes is determined according to the node information of each of the nodes and the priority corresponding to the identification information of the operator included in the node information of each of the candidate nodes.
9. The method according to any one of claims 2 to 7, characterized in that: Determining the node type of each of the nodes according to the node information of each of the nodes and a preset classification rule includes: When the node information of the third node includes a numerical value, determining that the node type of the third node is a numerical type, wherein the third node is any one of the at least one nodes; or, When the node information of the third node includes waveform information, determining that the node information of the third node is of a waveform type, wherein the waveform information includes identification information of a waveform function and at least one waveform parameter index value; or, When the node information of the third node includes identification information of the operator, it is determined that the node information of the third node is an operator type.
10. The method according to any one of claims 1 to 7, characterized in that: The operator in the node information of each of the nodes includes one element of addition, subtraction, multiplication, division, unary minus, derivation, mixing, and conjugation, and the priority of the operator includes a first priority, a second priority, and a third priority; The operators of the first priority level include one or more of the following: unary minus, derivative, mixing, and conjugation; The operators of the second priority level include one or more of the following: multiplication, division; The operators of the third priority level include one or more of the following: addition and subtraction.
11. The method according to any one of claims 1 to 7, characterized in that: The determining whether waveform data corresponding to the target hash value exists in the cache of the target object includes: Determining whether there is a hash value consistent with the target hash value in the cache; When it is determined that a hash value consistent with the target hash value exists in the cache, determining that waveform data corresponding to the target hash value exists in the cache of the target object; or, When it is determined that there is no hash value consistent with the target hash value in the cache, it is determined that there is waveform data corresponding to the target hash value in the cache of the target object.
12. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When it is determined that the waveform data corresponding to the target hash value exists in the cache and the target object is the wave generating device, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the target hash value.
13. The method according to any one of claims 1 to 7, characterized in that: When it is determined that the waveform data corresponding to the target hash value does not exist in the cache of the target object, the method further includes: Extracting identification information of the waveform function from node information of at least one of the nodes; According to the identification information of the waveform function, acquiring a waveform calculation method corresponding to the waveform function; Generate target code according to the waveform calculation method corresponding to the waveform function, the node information and the level of each of the nodes; Executing the target code to generate waveform data corresponding to the waveform indication information; When the target object is the waveform analysis device, the waveform data corresponding to the waveform indication information is sent to the wave generating device to generate a microwave pulse corresponding to the waveform indication information.
14. The method according to claim 13, characterized in that The method further comprises: When the target object is the wave generating device, a microwave pulse corresponding to the waveform indication information is generated according to the waveform data corresponding to the waveform indication information.
15. The method according to claim 4, characterized in that When the waveform parameter index value is a floating point number, performing hash calculation on each of the waveform parameter index values to obtain a hash value corresponding to each of the waveform parameter index values includes: According to a preset hash precision and a target waveform parameter index value, a hash value corresponding to the target waveform parameter index value is determined, wherein the target waveform parameter index value is any one of the at least one waveform parameter index value.
16. The method according to claim 15, characterized in that The hash value corresponding to the target waveform parameter index value is determined according to the preset hash accuracy and the target waveform parameter index value, using the following expression: H = round (n / HASHERR) Among them, H is the hash value corresponding to the target waveform parameter index value, n is the target waveform parameter index value, and HASHERR is the preset hash accuracy.
17. A waveform analysis device, characterized in that: include: An acquisition module, used for acquiring waveform indication information; A parsing module, used to parse the waveform indication information to obtain node information of at least one node; A generating module, configured to generate a target hash value corresponding to the waveform indication information according to the node information of each of the nodes; A determination module, used to determine whether there is waveform data corresponding to the target hash value in the cache of the target object; A sending module is used to send the waveform data corresponding to the target hash value in the cache to a wave generating device to generate a microwave pulse corresponding to the waveform indication information when it is determined that the waveform data corresponding to the target hash value exists in the cache and the target object is a waveform parsing device.
18. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the waveform analysis method according to any one of claims 1 to 16 by executing the computer instructions.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the waveform analysis method according to any one of claims 1 to 16.
20. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the waveform analysis method according to any one of claims 1 to 16.