CN115079771A - Waveform generation method, waveform storage method, device, equipment and storage medium - Google Patents

Waveform generation method, waveform storage method, device, equipment and storage medium Download PDF

Info

Publication number
CN115079771A
CN115079771A CN202210693457.XA CN202210693457A CN115079771A CN 115079771 A CN115079771 A CN 115079771A CN 202210693457 A CN202210693457 A CN 202210693457A CN 115079771 A CN115079771 A CN 115079771A
Authority
CN
China
Prior art keywords
amplitude
waveform
sequence
amplitudes
independent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210693457.XA
Other languages
Chinese (zh)
Other versions
CN115079771B (en
Inventor
李宁
温子瑜
乔爱国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Xinhai Microelectronics Technology Co ltd
Original Assignee
Xi'an Xinhai Microelectronics Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Xinhai Microelectronics Technology Co ltd filed Critical Xi'an Xinhai Microelectronics Technology Co ltd
Priority to CN202210693457.XA priority Critical patent/CN115079771B/en
Publication of CN115079771A publication Critical patent/CN115079771A/en
Application granted granted Critical
Publication of CN115079771B publication Critical patent/CN115079771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/02Digital function generators
    • G06F1/022Waveform generators, i.e. devices for generating periodical functions of time, e.g. direct digital synthesizers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Electrophonic Musical Instruments (AREA)

Abstract

The application provides a waveform generation method, a waveform storage method, a device, equipment and a storage medium, wherein the waveform generation method comprises the following steps: acquiring a waveform data packet of a target waveform to be generated; and generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value. The simplified data packet is obtained by simplifying the waveform amplitude sequence, and waveform generation is carried out according to the data packet after the waveform data packet is received, so that the efficiency of waveform data transmission is greatly improved.

Description

Waveform generation method, waveform storage method, device, equipment and storage medium
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a waveform generation method, a waveform storage method, a waveform generation apparatus, a waveform storage apparatus, and a storage medium.
Background
With the development of electronic technology, the application of waveforms in electronic products is becoming widespread, often used to represent the shapes, forms, etc. of signals; including signal transmission in addition to haptic feedback for functionality, and in many fields of human-computer interaction. Such as application fields: the mobile phone, the tablet personal computer, the mobile phone/bracelet, the automobile instrument panel, the game machine and the like perform signal transmission and feedback by reading the stored waveform signals.
In the prior art, generally, the waveform is stored by storing the amplitude sequence of the waveform, and a corresponding waveform data packet is generated for realizing the transmission of the waveform signal, however, when the waveform length is longer, the corresponding waveform amplitude sequence is longer, and a larger waveform data packet is generated, which results in lower efficiency of waveform data transmission.
Disclosure of Invention
The application provides a waveform generation method, a waveform storage method, a device, equipment and a storage medium, which abandon the traditional method of storing the amplitude sequence of the waveform as a data packet, simplify the waveform amplitude sequence to obtain the simplified data packet, and generate the waveform according to the data packet after receiving the waveform data packet, thereby greatly improving the efficiency of waveform data transmission.
In a first aspect, the present application provides a waveform generation method, including:
acquiring a waveform data packet of a target waveform to be generated;
and generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
In a possible implementation manner of the present application, the generating a target waveform according to the waveform amplitudes in the waveform data packet and the number of amplitudes corresponding to each of the waveform amplitudes includes:
matching the data format of the data in the waveform data packet with a preset data format;
setting data in the waveform data packet, the data format of which is not matched with a preset data format, as an independent amplitude;
processing data of which the data format is matched with a preset data format in the waveform data packet to obtain waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude;
and generating a target waveform according to the independent amplitude, the waveform amplitude and the number of amplitudes corresponding to each waveform amplitude.
In a possible implementation manner of the present application, the generating a target waveform according to the independent amplitude and the waveform amplitude and the number of amplitudes corresponding to each of the waveform amplitudes includes:
copying the waveform amplitude according to the number of amplitudes corresponding to the waveform amplitude to obtain an amplitude sequence section corresponding to the waveform amplitude;
if the independent amplitude exists, sequencing the independent amplitude and the amplitude sequence section according to the position of the data corresponding to the independent amplitude and the position of the data corresponding to the amplitude sequence section in the waveform data packet to obtain a target waveform;
and if the independent amplitude does not exist, sequencing the amplitude sequence segment according to the position of the data corresponding to the amplitude sequence segment in the waveform data packet to obtain a target waveform.
In a possible implementation manner of the present application, before acquiring a waveform data packet of a target waveform to be generated, the method further includes:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction;
splitting the amplitude sequence into independent amplitude and amplitude sequence segments;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the converted data and the independent amplitude according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence, and generating a waveform data packet corresponding to the waveform to be stored.
In one possible implementation manner of the present application, the splitting the amplitude sequence into independent amplitude and amplitude sequence segments includes:
extracting amplitude sequence segments with the same adjacent amplitude in the amplitude sequence;
and extracting independent amplitude values with different adjacent amplitude values in the amplitude value sequence.
In a possible implementation manner of the present application, the extracting a segment of the amplitude sequence in which adjacent amplitudes are the same in the amplitude sequence includes:
extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
In a possible implementation manner of the present application, after receiving a waveform storage instruction and obtaining an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction, the method further includes:
responding to the waveform storage instruction, and determining a free storage space;
if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
In a second aspect, the present application provides a waveform storage method, including:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored;
splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to the similarity between continuous amplitudes in the amplitude sequence;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored.
In a possible implementation manner of the present application, the splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to similarities between consecutive amplitudes in the amplitude sequence includes:
extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
In a possible implementation manner of the present application, after receiving a waveform storage instruction and obtaining an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction, the method further includes:
responding to the waveform storage instruction, and determining a free storage space;
if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
In a third aspect, the present application provides a waveform generation apparatus, the apparatus comprising:
an acquisition module: the method comprises the steps of obtaining a waveform data packet of a target waveform to be generated;
a generation module: and the target waveform is generated according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
In a fourth aspect, the present application provides an electronic device comprising:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement any of the waveform generation methods or any of the waveform storage methods.
In a fifth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which is loaded by a processor to perform any of the waveform generation methods or any of the steps in the waveform storage method.
The method comprises the steps of obtaining a waveform data packet of a target waveform to be generated; and then generating a target waveform according to the waveform amplitude in the waveform data packet and the number of the amplitudes corresponding to each waveform amplitude. The method has the advantages that the method that waveform data are obtained by analyzing the waveform data packet comprising the waveform amplitude sequence in the traditional technical scheme is abandoned, the corresponding target waveforms are generated by the waveform amplitudes in the waveform data packet and the number of the amplitudes corresponding to the waveform amplitudes, the size of the waveform data packet is reduced, data transmission flow is saved, and the waveform generation is carried out according to the data packet after the waveform data packet is received, so that the efficiency of waveform data transmission is greatly improved. The method comprises the steps of obtaining an amplitude sequence of a waveform to be stored by receiving a waveform storage instruction; then according to the similarity between the continuous amplitudes in the amplitude sequence, splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments; converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format; and then sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored. The method abandons the mode that waveform data packets are obtained by storing the waveform amplitude sequence in the traditional technical scheme, splits the amplitude sequence by the similarity of the waveform amplitude in the amplitude sequence corresponding to the waves to be stored, converts the data of the amplitude sequence section obtained by the splitting process, generates a data packet and stores the waveforms to be stored, reduces the data volume, reduces the size of the waveform data packet, saves the data transmission flow and greatly improves the efficiency of waveform data transmission.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a scenario of waveform generation provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a waveform generation method provided in an embodiment of the present application;
FIG. 3 is a schematic flowchart of an embodiment of generating a target waveform in the waveform generation method provided in the embodiment of the present application;
fig. 4 is a schematic flowchart of an embodiment of generating a target waveform according to independent amplitudes and numbers of waveform amplitudes in a waveform generation method provided in an embodiment of the present application;
FIG. 5 is a schematic flowchart of an embodiment of waveform storage in the waveform generation method provided in the embodiment of the present application;
FIG. 6 is a flowchart illustrating an embodiment of amplitude sequence splitting in a waveform generation method provided in an embodiment of the present application;
FIG. 7 is a schematic flow chart diagram illustrating an embodiment of amplitude sequence replacement in the waveform generation method provided in the embodiments of the present application;
fig. 8 is a schematic structural diagram of an embodiment of a waveform generation apparatus provided in an embodiment of the present application;
FIG. 9 is a schematic flow chart of a waveform storage method according to an embodiment of the present application;
FIG. 10 is a schematic flow chart of another waveform storage method provided in an embodiment of the present application;
FIG. 11 is a schematic structural diagram of an embodiment of a waveform storage device provided in an embodiment of the present application;
fig. 12 is a schematic structural diagram of an embodiment of an electronic device provided in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be considered as limiting the present invention. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the invention. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known structures and processes are not shown in detail to avoid obscuring the description of the invention with unnecessary detail. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
Embodiments of the present application provide a waveform generation method, apparatus, device, and computer readable storage medium, which are described in detail below.
The waveform generation method in the embodiment of the present invention is applied to a waveform generation apparatus provided in an electronic device, in which one or more processors, a memory, and one or more application programs are provided, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the waveform generation method; the electronic device may be a terminal, such as a mobile phone or a tablet computer, and the electronic device may also be a server or a service cluster formed by multiple servers.
As shown in fig. 1, fig. 1 is a schematic view of a scenario of a waveform generation method according to an embodiment of the present application, where the scenario of waveform generation includes an electronic device 100 (a waveform generation apparatus is integrated in the electronic device 100), and the electronic device 100 runs a computer-readable storage medium corresponding to waveform generation to execute a step of waveform generation.
It should be understood that the electronic device or the apparatus included in the electronic device in the scenario of the waveform generation method shown in fig. 1 does not limit the embodiment of the present invention, that is, the number of devices and the type of devices included in the scenario of the waveform generation method, or the number of apparatuses and the type of apparatuses included in each device do not affect the overall implementation of the technical solution in the embodiment of the present invention, and can be calculated as equivalent replacements or derivatives of the technical solution claimed in the embodiment of the present invention.
The electronic device 100 in the embodiment of the present invention is mainly used for: acquiring a waveform data packet of a target waveform to be generated; and generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
The electronic device 100 in this embodiment of the present invention may be an independent electronic device, or an electronic device network or an electronic device cluster composed of electronic devices, for example, the electronic device 100 described in this embodiment of the present invention includes, but is not limited to, a computer, a network host, a single network electronic device, multiple network electronic device sets, or a cloud electronic device composed of multiple electronic devices. Among them, the Cloud electronic device is constituted by a large number of computers or network electronic devices based on Cloud Computing (Cloud Computing).
Those skilled in the art can understand that the application environment shown in fig. 1 is only one application scenario related to the present application, and does not constitute a limitation on the application scenario of the present application, and that other application environments may further include more or fewer electronic devices than those shown in fig. 1, or a network connection relationship of electronic devices, for example, only 1 electronic device is shown in fig. 1, and it can be understood that the scenario of the waveform generation method may further include one or more other electronic devices, which is not limited herein; the electronic device 100 may further include a memory for storing data, such as waveform identifiers, waveform data packets, and the like.
In addition, in a scenario of the waveform generation method of the present application, the electronic device 100 may be provided with a display device, or the electronic device 100 is not provided with a display device to be in communication connection with an external display device 200, and the display device 200 is configured to output a result of execution of the waveform generation method in the electronic device. The electronic device 100 may access the background database 300 (the background database may be in a local memory of the electronic device, and may also be set in the cloud), and the background database 300 stores information related to waveform generation, such as a waveform amplitude sequence and a waveform identifier in the background database 300.
It should be noted that the scene schematic diagram of the waveform generating method shown in fig. 1 is only an example, and the scene of the waveform generating method described in the embodiment of the present invention is for more clearly illustrating the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided in the embodiment of the present invention.
Based on the scenario of the waveform generation method, an embodiment of the waveform generation method is proposed.
Referring to fig. 2, fig. 2 is a schematic flow chart of a waveform generation method provided in an embodiment of the present application, where the waveform generation method includes steps 201 and 202:
201. and acquiring a waveform data packet of a target waveform to be generated.
The waveform data packet includes data obtained by simplifying a waveform amplitude sequence, and it can be understood that the waveform amplitude sequence includes a plurality of amplitudes arranged in sequence, and the corresponding waveform can be obtained by sequentially outputting the waveform amplitude sequence.
Specifically, it can be understood that the waveform amplitude sequence includes a plurality of amplitudes according to different lengths of the waveform, where there may be a case where consecutive amplitudes are the same, for example, the waveform sequence includes consecutive amplitudes 5, then, in the prior art, 6 bytes need to be occupied to store corresponding amplitudes, in the present application, simplified processing is performed on consecutive identical amplitudes that meet a certain preset rule, so as to obtain simplified data, and the simplified data is stored in a corresponding waveform data packet, where the simplified data includes amplitude number information 6 corresponding to the waveform amplitude 5 and the waveform amplitude, and the storage 5, 6 only occupies 2 bytes. It can be understood that the simplified data format is not specifically limited in this application, and the corresponding waveform amplitude and the amplitude number information corresponding to the waveform amplitude may be obtained according to the data format.
Specifically, in the embodiment of the present application, the waveform generation method is applied to electronic devices, and the type and the number of the electronic devices are not particularly limited, that is, the electronic device may be a terminal or a server, for example, the electronic device is a mobile phone. The electronic device may obtain a waveform data packet of a target waveform to be generated through a data obtaining module of the electronic device, for example, a touch screen, a key of the electronic device, or may receive a waveform generating instruction through an external receiving device in communication connection with the electronic device, for example, a mobile phone, a computer, or the like in communication connection with the electronic device.
It can be understood that the electronic device may obtain the waveform data packet of the target waveform to be generated actively or passively, for example, the electronic device obtains the waveform data packet of the target waveform to be generated when receiving the waveform generation instruction, that is, the waveform generation instruction is used to trigger waveform generation and indicate the target waveform, it can be understood that the electronic device may also obtain the waveform data packet of the target waveform to be generated after passively receiving the data packet sent by the third-party device, it can be understood that the waveform data packet may carry a waveform identifier of the target waveform, or the electronic device may obtain the waveform identifier of the target waveform by analyzing the instruction after receiving the waveform generation instruction, or when the electronic device receives the waveform generation instruction, it may automatically trigger feedback of the target waveform to be selected to a display interface of the electronic device or an external display device in communication connection with the electronic device, the waveform identifier of the target waveform is obtained, and the specific application is not specifically limited.
Specifically, after determining a waveform identifier of a target waveform, the electronic device may understand that the waveform packet may be stored in the electronic device or an external storage device communicatively connected to the electronic device, and may understand that the waveform identifier and the waveform packet have an association relationship.
202. And generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
Wherein the waveform amplitude is used for indicating that the amplitude sequence of the target waveform has continuously repeated amplitudes, and the number of amplitudes corresponding to the waveform amplitude, i.e., the number of amplitude values having consecutive repetitions in the amplitude sequence of the target waveform, it is to be understood that, the amplitude sequence of the target waveform may include a plurality of amplitude sequence segments having continuously repeating amplitudes, that is, each amplitude sequence segment in the waveform data packet has a plurality of corresponding waveform amplitudes and the number of amplitudes corresponding to each of the waveform amplitudes, and further, it can be understood that the waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude are sequentially arranged corresponding to the positions of each amplitude sequence segment in the amplitude sequence to generate corresponding waveform data packets, that is, the waveform data packet includes a plurality of waveform amplitudes ordered according to the amplitude sequence and the number of amplitudes corresponding to each of the waveform amplitudes.
It can be understood that, after acquiring a waveform data packet of a target waveform to be generated, the electronic device analyzes data in the waveform data packet in sequence to obtain waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude, and restores a waveform amplitude sequence according to the waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude to obtain the target waveform.
Further, it is understood that in some embodiments of the application, the amplitude sequence of the target waveform may further include discontinuously repeated amplitudes, that is, the waveform data packet may include two types of data for representing continuously repeated amplitude information and non-repeated amplitude information, specifically, referring to fig. 3, in an embodiment of the application, the step 202 includes the steps 301 and 304:
301. matching the data format of the data in the waveform data packet with a preset data format;
302. setting data in the waveform data packet, the data format of which is not matched with a preset data format, as an independent amplitude;
303. processing data of which the data format is matched with a preset data format in the waveform data packet to obtain waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude;
304. and generating a target waveform according to the independent amplitude, the waveform amplitude and the number of amplitudes corresponding to each waveform amplitude.
It can be understood that, when the amplitude sequence of the target waveform includes discontinuous repetition amplitudes and continuous repetition amplitudes, there may be two formats of data formats, and it can be understood that the data for representing the continuously repeated amplitude information at least includes the waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes, that is, at least includes a length of two bytes, but if the data format is used for storing the discontinuous repetition amplitudes in the amplitude sequence of the target waveform, more bytes are occupied than if only one byte is needed to store the waveform. Therefore, in the embodiment of the application, by defining the data format for representing the continuously repeated amplitude information and identifying the data for representing the continuously repeated amplitude information in the waveform data packet through the data format in the waveform data packet, the identification of the data in the waveform data packet can be realized more accurately under the condition that the stored information of the waveform data packet occupies minimum bytes, the accuracy of data identification is ensured, and the generation of the target waveform can be realized quickly.
Specifically, the independent amplitude is a non-repeating amplitude, a data format for representing continuously repeated amplitude information is the same as the preset data format, that is, the data format in the waveform data packet matches the preset data format, or otherwise does not match the preset data format, specifically, the data format is not specifically limited in this application, it can be understood that the preset data format may carry a data identifier, that is, the preset data format may indicate waveform amplitude information in data corresponding to the data format and amplitude number information corresponding to the waveform amplitude, for example, the data format for representing continuously repeated amplitude information may be 5xFF, where 5 is the highest bit of data representing continuously repeated amplitude information, the highest bit is defined as a waveform amplitude associated with repetition, and FF is the lowest bit of data representing continuously repeated amplitude information, and limiting the lowest bit to represent the number of amplitudes corresponding to the continuously repeated waveform amplitudes, and generating the target waveform by the electronic equipment according to the independent amplitudes, the waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude.
It can be understood that the independent amplitude values and the data representing continuously repeated amplitude value information are arranged corresponding to the order of the amplitude value sequence when generating the data packet, that is, the electronic device analyzes the data in the data packet in sequence to obtain the target waveform.
Specifically, referring to fig. 4, in an embodiment of the present application, the generating, by the electronic device, the target waveform according to the independent amplitude and the number of the waveform amplitudes and the amplitudes corresponding to each of the waveform amplitudes specifically includes steps 401 and 403:
401. copying the waveform amplitude according to the number of amplitudes corresponding to the waveform amplitude to obtain an amplitude sequence section corresponding to the waveform amplitude;
402. if the independent amplitude exists, sequencing the independent amplitude and the amplitude sequence section according to the position of the data corresponding to the independent amplitude and the position of the data corresponding to the amplitude sequence section in the waveform data packet to obtain a target waveform;
403. and if the independent amplitude does not exist, sequencing the amplitude sequence segment according to the position of the data corresponding to the amplitude sequence segment in the waveform data packet to obtain a target waveform.
Specifically, the electronic device copies the waveform amplitude according to the number of amplitudes corresponding to the waveform amplitude, that is, the electronic device deeply performs a sequence of amplitude sequences corresponding to a repetition of the waveform amplitude in an amplitude sequence according to the waveform amplitude and the number of amplitudes corresponding to each waveform amplitude to obtain an amplitude sequence segment, and it can be understood that each data (including an independent amplitude and data indicating continuously repeated amplitude information) in a waveform data packet is arranged according to the amplitude sequence of a target waveform, that is, the electronic device sorts the independent amplitude and the amplitude sequence segment according to the position of the data corresponding to the independent amplitude and the position of the data corresponding to the amplitude sequence segment in the waveform data packet to obtain the target waveform and obtain the corresponding target waveform. Similarly, it can be understood that, if there is no independent amplitude, that is, all data in a data packet respectively correspond to an amplitude sequence segment, the amplitude sequence segments are sorted according to the positions of the data corresponding to the amplitude sequence segments in the waveform data packet, so as to obtain a target waveform.
Further, referring to fig. 5, in one embodiment of the present application, the step 201 further comprises a step 501-504:
501. and receiving a waveform storage instruction, and acquiring an amplitude sequence of the waveform to be stored corresponding to the waveform storage instruction.
The electronic device receives a waveform storage instruction, determines an amplitude sequence, that is, when the waveform storage device receives the waveform storage instruction, starts waveform storage, and it can be understood that the waveform storage instruction may carry a waveform identifier of the amplitude sequence, and the waveform storage device parses the instruction after receiving the waveform storage instruction to obtain the waveform identifier corresponding to the amplitude sequence, or automatically triggers and feeds back the waveform corresponding to the amplitude sequence to select a display interface of the waveform storage device or an external display device in communication connection with the waveform storage device to obtain the waveform identifier of the amplitude sequence when the waveform storage device receives the waveform storage instruction, and this application is not specifically limited.
502. Splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
Specifically, the electronic device divides the amplitude sequence into independent amplitude and amplitude sequence segments by sequentially analyzing the amplitudes of the amplitude sequence according to the amplitude sequence corresponding to the waveform storage instruction.
And arranging the split amplitude sequence segment and the pair of amplitudes corresponding to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to obtain the split independent amplitudes and the split amplitude sequence segment.
Wherein, the amplitude sequence segment comprises a plurality of repeated amplitudes arranged in sequence.
503. And converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format.
In an embodiment of the present application, the electronic device converts each of the amplitude sequence segments into data including a waveform amplitude and an amplitude number corresponding to the waveform amplitude, where a specific format is not specifically defined in the present application, where a is a highest bit of data representing continuously repeated amplitude information, the highest bit is defined as a repeatedly connected waveform amplitude, FF is a lowest bit of data representing continuously repeated amplitude information, and the lowest bit is defined as the amplitude number corresponding to the continuously repeated waveform amplitude, and the electronic device generates a target waveform according to the independent amplitude and the waveform amplitude and the amplitude number corresponding to each of the waveform amplitudes, and generates a preset data format according to the format of the data.
504. And sequentially storing the converted data and the independent amplitude according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence, and generating a waveform data packet corresponding to the waveform to be stored.
The electronic device stores the converted data and the amplitude sequence corresponding to the independent amplitude in sequence, that is, the independent amplitude and the converted data are stored in sequence according to the position corresponding to the independent amplitude and the position corresponding to the amplitude sequence segment in the amplitude sequence of the target waveform, it can be understood that the converted preset data format corresponding to the amplitude sequence segment may be stored in association with the waveform data packet, or the preset data format may be stored in the waveform data packet, and a storage position is designated, and the specific application is not limited thereto.
Specifically, referring to fig. 6, in one embodiment of the present application, the step 502 further includes a step 601 and a step 602:
601. extracting amplitude sequence segments with the same adjacent amplitude in the amplitude sequence;
602. and extracting independent amplitude values with different adjacent amplitude values in the amplitude value sequence.
Specifically, extracting amplitude sequence segments with the same adjacent amplitude values in the amplitude sequence specifically includes:
(1) extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
(2) if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
(3) and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
The initial amplitude sequence segment comprises at least two identical amplitudes, the preset number threshold value can be 3, 4 and the like, and the initial amplitude sequence segment is judged to be the amplitude sequence segment by limiting if the number of the amplitudes in the initial amplitude sequence segment is larger than the preset number threshold value, so that the phenomenon that the number of the amplitudes in the initial amplitude sequence segment is too small, and the phenomenon that converted data occupies more bytes than the amplitudes in the initial amplitude sequence segment are stored independently can be avoided.
Further, referring to fig. 7, in one embodiment of the present application, step 501 is followed by step 701 and step 703:
701. responding to the waveform storage instruction, and determining a free storage space;
702. if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
703. and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
The electronic device responds to the waveform storage instruction and obtains a corresponding free storage space, that is, obtains a remaining storage space of a storage location of an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction, and it can be understood that the free storage space can be obtained by feeding back the storage location of the waveform to be stored after the electronic device receives the waveform storage instruction, and obtaining the waveform according to the storage location, or inquiring a preset storage address according to the waveform to be stored determined by the waveform storage instruction, and determining the waveform according to the preset storage address, which is not limited in the present application.
The expected storage space of the amplitude sequence, that is, the storage space occupied by the amplitude sequence, may be understood that storing the waveform is to store the amplitude sequence of the waveform, and may obtain the corresponding expected storage space by counting the number of amplitudes of the waveform amplitudes and analyzing and estimating data corresponding to repeated continuous amplitudes, for example, after obtaining the amplitude sequence, counting the amplitude number of the amplitude sequence to be 12, that is, the amplitude sequence to be expected to occupy 12 byte spaces (expected storage spaces), and counting the number of storable bytes (remaining storage spaces) of the storage location corresponding to the amplitude sequence of the waveform to be stored, where if the number of storable bytes of the storage location is 10, the expected storage space of the amplitude sequence is greater than the free storage space.
It can be understood that if the predicted storage space of the amplitude sequence is larger than the free storage space, a waveform storage failure may be caused, if the predicted storage space of the amplitude sequence is larger than the free storage space, a replaced amplitude sequence is obtained by performing mean value replacement on amplitudes whose adjacent amplitude difference values of the amplitude sequence are smaller than a preset difference threshold, and the replaced amplitude sequence is split into independent amplitude values and amplitude sequence segments, that is, the number of independent amplitude values in the amplitude sequence may be reduced, and data of the amplitude sequence segments may be reduced, so as to further store an occupied space and ensure waveform storage.
It is to be understood that if the expected storage space of the magnitude sequence is less than or equal to the free storage space, i.e. the storage space is sufficient, then step 501 is executed.
The method comprises the steps of obtaining a waveform data packet of a target waveform to be generated; and then generating a target waveform according to the waveform amplitude in the waveform data packet and the number of the amplitudes corresponding to each waveform amplitude. The method has the advantages that the method that waveform data are obtained by analyzing the waveform data packet comprising the waveform amplitude sequence in the traditional technical scheme is abandoned, the corresponding target waveforms are generated by the waveform amplitudes in the waveform data packet and the number of the amplitudes corresponding to the waveform amplitudes, the size of the waveform data packet is reduced, data transmission flow is saved, and the waveform generation is carried out according to the data packet after the waveform data packet is received, so that the efficiency of waveform data transmission is greatly improved.
In order to better implement the waveform generation method in the embodiment of the present application, on the basis of the waveform generation method, the embodiment of the present application further provides a waveform generation device, as shown in fig. 8, the waveform generation device includes 801 and 802:
the acquisition module 801: the method comprises the steps of obtaining a waveform data packet of a target waveform to be generated;
the generation module 802: and the target waveform is generated according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
Further, in some embodiments of the present application, the generating module 802 further includes:
matching the data format of the data in the waveform data packet with a preset data format;
setting data in the waveform data packet, the data format of which is not matched with a preset data format, as an independent amplitude;
processing data of which the data format is matched with a preset data format in the waveform data packet to obtain waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude;
and generating a target waveform according to the independent amplitude, the waveform amplitude and the number of amplitudes corresponding to each waveform amplitude.
Further, in some embodiments of the present application, the generating module 802 is configured to: generating a target waveform according to the independent amplitude, the waveform amplitude and the number of amplitudes corresponding to each waveform amplitude, which specifically comprises the following steps:
copying the waveform amplitude according to the number of amplitudes corresponding to the waveform amplitude to obtain an amplitude sequence section corresponding to the waveform amplitude;
if the independent amplitude exists, sequencing the independent amplitude and the amplitude sequence section according to the position of the data corresponding to the independent amplitude and the position of the data corresponding to the amplitude sequence section in the waveform data packet to obtain a target waveform;
and if the independent amplitude does not exist, sequencing the amplitude sequence segment according to the position of the data corresponding to the amplitude sequence segment in the waveform data packet to obtain a target waveform.
Further, in some embodiments of the present application, the waveform generating apparatus further includes a storage module, configured to:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction;
splitting the amplitude sequence into independent amplitude and amplitude sequence segments;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the converted data and the amplitude sequence corresponding to the independent amplitude to generate a waveform data packet corresponding to the waveform to be stored.
Further, in some embodiments of the present application, the storage module is configured to split the amplitude sequence into independent amplitude and amplitude sequence segments, and specifically includes:
splitting the amplitude values with the same adjacent amplitude values in the amplitude value sequence segment into amplitude value sequence segments;
and splitting the amplitudes with different adjacent amplitudes in the amplitude sequence segment into independent amplitudes.
Further, in some embodiments of the present application, the waveform generating apparatus further includes a storage module, configured to: splitting the amplitude values with the same adjacent amplitude values in the amplitude value sequence segment into amplitude value sequence segments, specifically comprising:
splitting the amplitude with the same adjacent amplitude in the amplitude sequence segment into an initial amplitude sequence segment;
if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
and if the number of the amplitude values in the initial amplitude value sequence segment is less than or equal to a preset number threshold value, splitting the amplitude values in the initial amplitude value sequence segment into independent amplitude values.
Further, in some embodiments of the present application, the storage module further includes a module for:
acquiring a free storage space corresponding to the waveform storage instruction;
if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
The method comprises the steps of obtaining a waveform data packet of a target waveform to be generated by providing a waveform generating device; and then generating a target waveform according to the waveform amplitude in the waveform data packet and the number of the amplitudes corresponding to each waveform amplitude. The method has the advantages that the method that waveform data are obtained by analyzing the waveform data packet comprising the waveform amplitude sequence in the traditional technical scheme is abandoned, the corresponding target waveforms are generated by the waveform amplitudes in the waveform data packet and the number of the amplitudes corresponding to the waveform amplitudes, the size of the waveform data packet is reduced, data transmission flow is saved, and the waveform generation is carried out according to the data packet after the waveform data packet is received, so that the efficiency of waveform data transmission is greatly improved.
Referring to fig. 9, fig. 9 is a schematic flowchart of a waveform storage method provided in an embodiment of the present application, where the waveform storage method includes steps 901 and 904:
901. and receiving a waveform storage instruction, and acquiring an amplitude sequence of the waveform to be stored.
Specifically, in the embodiment of the present application, the waveform storage method is applied to an electronic device, and the type and the number of the electronic device are not specifically limited, that is, the electronic device may be a terminal or a server, for example, the electronic device is a mobile phone. The electronic device may obtain a waveform data packet of a target waveform to be stored through a data obtaining module of the electronic device, for example, a touch screen, a key of the electronic device, or may receive a waveform storage instruction through an external receiving device in communication connection with the electronic device, for example, a mobile phone, a computer, or the like in communication connection with the electronic device.
It can be understood that, after receiving the waveform storage instruction, the electronic device obtains the amplitude sequence of the waveform to be stored, that is, when receiving the waveform storage instruction, the waveform storage device starts waveform storage, and it can be understood that the waveform storage instruction may carry a waveform identifier of the amplitude sequence, and the waveform storage device parses the instruction after receiving the waveform storage instruction to obtain the waveform identifier corresponding to the amplitude sequence, or automatically triggers and feeds back the waveform corresponding to the amplitude sequence to select to a display interface of the waveform storage device or to an external display device in communication connection with the waveform storage device when receiving the waveform storage instruction, so as to obtain the waveform identifier of the amplitude sequence.
901. And splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to the similarity between continuous amplitudes in the amplitude sequence.
Specifically, amplitude sequence segments with the same adjacent amplitude in the amplitude sequence are extracted; and if the similarity of the target amplitude value in the amplitude sequence and the amplitude value at the front position of the target amplitude value and the similarity of the target amplitude value and the amplitude value at the rear position of the target amplitude value are both in a second threshold value interval, extracting the target amplitude value as an independent amplitude value.
In one embodiment of the present application, extracting the amplitude sequence segment and the independent amplitude specifically includes:
(1) extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
(2) if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
(3) and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
It is understood that, in which the initial amplitude sequence segment includes at least two identical amplitudes, the preset number threshold may be 3, 4, etc., determining the initial amplitude sequence segment as an amplitude sequence segment by limiting if the number of the amplitudes in the initial amplitude sequence segment is greater than a preset number threshold, it can be avoided that the number of amplitudes included in the initial amplitude sequence segment is too small, resulting in that the converted data occupies more bytes than the amplitudes in the initial amplitude sequence segment alone would occupy for storage, and the waveform analysis procedure is wasted during reading, for example, if the extracted initial amplitude sequence segment includes two amplitudes, and the amplitudes are all 5, at this time, the amplitude of the converted waveform is 5, the number of the amplitudes is 2, two storage bytes are occupied, and respectively extracting the amplitude 5 in the initial amplitude sequence segment as an independent amplitude to be stored, so that the waste of a data packet analysis program during waveform generation is avoided.
903. And converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format.
In an embodiment of the present application, the electronic device converts each of the amplitude sequence segments into data including a waveform amplitude and an amplitude number corresponding to the waveform amplitude, where a specific format is not specifically defined in the present application, where a is a highest bit of data representing continuously repeated amplitude information, the highest bit is defined as a repeatedly connected waveform amplitude, FF is a lowest bit of data representing continuously repeated amplitude information, and the lowest bit is defined as the amplitude number corresponding to the continuously repeated waveform amplitude, and the electronic device generates a target waveform according to the independent amplitude and the waveform amplitude and the amplitude number corresponding to each of the waveform amplitudes, and generates a preset data format according to the format of the data.
904. And sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored.
The electronic device stores the converted data and the amplitude sequence corresponding to the independent amplitude in sequence, that is, the independent amplitude and the converted data are stored in sequence according to the position corresponding to the independent amplitude and the position corresponding to the amplitude sequence segment in the amplitude sequence of the target waveform, it can be understood that the converted preset data format corresponding to the amplitude sequence segment may be stored in association with the waveform data packet, or the preset data format may be stored in the waveform data packet, and a storage position is designated, and the specific application is not limited thereto.
On the basis of the foregoing embodiment, referring to fig. 10, the present application further provides an embodiment of amplitude sequence processing, specifically, after receiving a waveform storage instruction and acquiring an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction, the method further includes steps 1001 and 1003:
1001. responding to the waveform storage instruction, and determining a free storage space;
1002. if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
1003. and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
The electronic device responds to the waveform storage instruction and obtains a corresponding free storage space, that is, obtains a remaining storage space of a storage location of an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction, and it can be understood that the free storage space can be obtained by feeding back the storage location of the waveform to be stored after the electronic device receives the waveform storage instruction, and obtaining the waveform according to the storage location, or inquiring a preset storage address according to the waveform to be stored determined by the waveform storage instruction, and determining the waveform according to the preset storage address, which is not limited in the present application.
The expected storage space of the amplitude sequence, that is, the storage space occupied by the amplitude sequence, may be understood that storing the waveform is to store the amplitude sequence of the waveform, and may obtain the corresponding expected storage space by counting the number of amplitudes of the waveform amplitudes and analyzing and estimating data corresponding to repeated continuous amplitudes, for example, after obtaining the amplitude sequence, counting the amplitude number of the amplitude sequence to be 12, that is, the amplitude sequence to be expected to occupy 12 byte spaces (expected storage spaces), and counting the number of storable bytes (remaining storage spaces) of the storage location corresponding to the amplitude sequence of the waveform to be stored, where if the number of storable bytes of the storage location is 10, the expected storage space of the amplitude sequence is greater than the free storage space.
It can be understood that if the predicted storage space of the amplitude sequence is larger than the free storage space, a waveform storage failure may be caused, if the predicted storage space of the amplitude sequence is larger than the free storage space, a replaced amplitude sequence is obtained by performing mean value replacement on amplitudes whose adjacent amplitude difference values of the amplitude sequence are smaller than a preset difference threshold, and the replaced amplitude sequence is split into independent amplitude values and amplitude sequence segments, that is, the number of independent amplitude values in the amplitude sequence may be reduced, and data of the amplitude sequence segments may be reduced, so as to further store an occupied space and ensure waveform storage.
It is to be understood that if the expected storage space of the magnitude sequence is less than or equal to the free storage space, i.e. the storage space is sufficient, then step 902 is executed.
The method comprises the steps of obtaining an amplitude sequence of a waveform to be stored by receiving a waveform storage instruction; then according to the similarity between the continuous amplitudes in the amplitude sequence, splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments; converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format; and then sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored. The method abandons the mode that waveform data packets are obtained by storing the waveform amplitude sequence in the traditional technical scheme, splits the amplitude sequence by the similarity of the waveform amplitude in the amplitude sequence corresponding to the waves to be stored, converts the data of the amplitude sequence section obtained by the splitting process, generates a data packet and stores the waveforms to be stored, reduces the data volume, reduces the size of the waveform data packet, saves the data transmission flow and greatly improves the efficiency of waveform data transmission.
In order to better implement the waveform storage method in the embodiment of the present application, based on the waveform storage method, the embodiment of the present application further provides a waveform storage device, as shown in fig. 11, the waveform storage device includes modules 1101 and 1104:
the receiving module 1101: the waveform storage device is used for receiving a waveform storage instruction and acquiring an amplitude sequence of a waveform to be stored;
the splitting module 1102: the amplitude sequence is divided into independent amplitudes and/or amplitude sequence segments according to the similarity between continuous amplitudes in the amplitude sequence;
a conversion module 1103: the amplitude sequence segments are used for converting the amplitude sequence segments into data comprising waveform amplitudes and the number of the amplitudes corresponding to the waveform amplitudes according to a preset data format;
the storage module 1104: and the waveform data packet is used for sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence, and generating the waveform data packet corresponding to the waveform to be stored.
In one embodiment of the present application, the splitting module 1102: the method is used for splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to similarities between consecutive amplitudes in the amplitude sequence, and specifically includes the steps of:
extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
In one embodiment of the present application, the waveform storage device further comprises a processing module: after the step of receiving the waveform storage instruction and obtaining the amplitude sequence of the waveform to be stored corresponding to the waveform storage instruction, the method further includes:
responding to the waveform storage instruction, and determining a free storage space;
if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
The application provides a waveform storage device, which obtains an amplitude sequence of a waveform to be stored by receiving a waveform storage instruction; then according to the similarity between the continuous amplitudes in the amplitude sequence, splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments; converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format; and then sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored. The method abandons the mode that waveform data packets are obtained by storing the waveform amplitude sequence in the traditional technical scheme, splits the amplitude sequence by the similarity of the waveform amplitude in the amplitude sequence corresponding to the waves to be stored, converts the data of the amplitude sequence section obtained by the splitting process, generates a data packet and stores the waveforms to be stored, reduces the data volume, reduces the size of the waveform data packet, saves the data transmission flow and greatly improves the efficiency of waveform data transmission.
An embodiment of the present invention further provides an electronic device, as shown in fig. 12, fig. 12 is a schematic structural diagram of an embodiment of the electronic device provided in the embodiment of the present application.
The electronic device integrates any waveform generation device provided by the embodiment of the invention, and comprises:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor for performing the steps of the waveform generation method described in any of the above-described waveform generation method embodiments.
Specifically, the method comprises the following steps: the electronic device may include components such as a processor 1201 of one or more processing cores, memory 1202 of one or more computer-readable storage media, a power supply 1203, and an input unit 1204. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 12 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the processor 1201 is a control center of the electronic apparatus, connects various parts of the entire electronic apparatus using various interfaces and lines, and performs various functions of the electronic apparatus and processes data by operating or executing software programs and/or modules stored in the memory 1202 and calling data stored in the memory 1202, thereby performing overall monitoring of the electronic apparatus. Optionally, the processor 1201 may include one or more processing cores; preferably, the processor 1201 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1201.
The memory 1202 may be used to store software programs and modules, and the processor 1201 executes various functional applications and data processing by operating the software programs and modules stored in the memory 1202. The memory 1202 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 1202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 1202 may also include a memory controller to provide the processor 1201 with access to the memory 1202.
The electronic device further comprises a power supply 1203 for supplying power to each component, and preferably, the power supply 1203 may be logically connected to the processor 1201 through a power management system, so that functions of managing charging, discharging, power consumption, and the like are realized through the power management system. The power supply 1203 may also include any component(s) such as one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The electronic device may further include an input unit 1204, and the input unit 1204 may be used to receive input numeric or character information and generate a keyboard, mouse, joystick, optical or trackball signal input in relation to user settings and function control.
Although not shown, the electronic device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 1201 in the electronic device loads the executable file corresponding to the process of one or more application programs into the memory 1202 according to the following instructions, and the processor 1201 runs the application programs stored in the memory 1202, so as to implement various functions as follows:
acquiring a waveform data packet of a target waveform to be generated;
and generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
Or the processor 1201 runs an application program stored in the memory 1202 to implement various functions as follows:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored;
splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to the similarity between continuous amplitudes in the amplitude sequence;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored.
To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like. Stored thereon, is a computer program, which is loaded by a processor to perform the steps of any of the waveform generation methods provided by the embodiments of the present invention. For example, the computer program may be loaded by a processor to perform the steps of:
acquiring a waveform data packet of a target waveform to be generated;
and generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
Alternatively, the computer program may be loaded by a processor to perform the steps of:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored;
splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to the similarity between continuous amplitudes in the amplitude sequence;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The waveform generating method, the waveform storing method, the apparatus, the device and the storage medium provided by the embodiments of the present application are described in detail above, and the specific examples are applied herein to illustrate the principle and the implementation of the present invention, and the description of the embodiments above is only used to help understanding the method and the core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (13)

1. A waveform generation method, comprising:
acquiring a waveform data packet of a target waveform to be generated;
and generating a target waveform according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
2. The method according to claim 1, wherein generating a target waveform according to the waveform amplitudes in the waveform data packet and the number of amplitudes corresponding to each of the waveform amplitudes comprises:
matching the data format of the data in the waveform data packet with a preset data format;
setting data of which the data format is not matched with a preset data format in the waveform data packet as an independent amplitude value;
processing data of which the data format is matched with a preset data format in the waveform data packet to obtain waveform amplitudes and the number of amplitudes corresponding to each waveform amplitude;
and generating a target waveform according to the independent amplitude, the waveform amplitude and the number of amplitudes corresponding to each waveform amplitude.
3. The method according to claim 2, wherein the generating a target waveform according to the independent amplitudes and the number of amplitude values corresponding to the waveform amplitude value and each of the waveform amplitude values comprises:
copying the waveform amplitude according to the number of amplitudes corresponding to the waveform amplitude to obtain an amplitude sequence section corresponding to the waveform amplitude;
if the independent amplitude exists, sequencing the independent amplitude and the amplitude sequence section according to the position of the data corresponding to the independent amplitude and the position of the data corresponding to the amplitude sequence section in the waveform data packet to obtain a target waveform;
and if the independent amplitude does not exist, sequencing the amplitude sequence segment according to the position of the data corresponding to the amplitude sequence segment in the waveform data packet to obtain a target waveform.
4. The method according to claim 1, wherein before the obtaining the waveform data packet of the target waveform to be generated, the method further comprises:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored corresponding to the waveform storage instruction;
splitting the amplitude sequence into independent amplitude and amplitude sequence segments;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the converted data and the independent amplitude according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence, and generating a waveform data packet corresponding to the waveform to be stored.
5. The method of waveform generation according to claim 4, wherein said splitting the sequence of magnitudes into separate magnitude and magnitude sequence segments comprises:
extracting amplitude sequence segments with the same adjacent amplitude in the amplitude sequence;
and extracting independent amplitude values with different adjacent amplitude values in the amplitude value sequence.
6. The waveform generation method according to claim 5, wherein the extracting of the amplitude sequence segments in which adjacent amplitudes in the amplitude sequence are the same comprises:
extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
7. The method according to claim 4, wherein after receiving the waveform storage instruction and obtaining the amplitude sequence of the waveform to be stored corresponding to the waveform storage instruction, the method further comprises:
responding to the waveform storage instruction, and determining a free storage space;
if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments is performed.
8. A method of storing a waveform, comprising:
receiving a waveform storage instruction, and acquiring an amplitude sequence of a waveform to be stored;
splitting the amplitude sequence into independent amplitudes and/or amplitude sequence segments according to the similarity between continuous amplitudes in the amplitude sequence;
converting each amplitude sequence segment into data comprising waveform amplitudes and the number of amplitudes corresponding to the waveform amplitudes according to a preset data format;
and sequentially storing the independent amplitude and/or the converted data according to the position of the amplitude sequence segment in the amplitude sequence and the position of the independent amplitude in the amplitude sequence to generate a waveform data packet corresponding to the waveform to be stored.
9. The method according to claim 8, wherein the splitting the amplitude sequence into independent amplitude values and/or amplitude sequence segments according to similarities between successive amplitude values in the amplitude sequence comprises:
extracting the amplitudes with the same adjacent amplitude in the amplitude sequence as an initial amplitude sequence segment;
if the number of the amplitude values in the initial amplitude value sequence segment is larger than a preset number threshold value, judging that the initial amplitude value sequence segment is an amplitude value sequence segment;
and if the number of the amplitude values in the initial amplitude value sequence section is less than or equal to a preset number threshold value, respectively extracting the amplitude values in the initial amplitude value sequence section as independent amplitude values.
10. The method according to claim 8, wherein after receiving the waveform storage instruction and obtaining the amplitude sequence of the waveform to be stored corresponding to the waveform storage instruction, the method further comprises:
responding to the waveform storage instruction, and determining a free storage space;
if the predicted storage space of the amplitude sequence is larger than the free storage space, performing mean value replacement on the amplitudes of which the difference values of the adjacent amplitudes of the amplitude sequence are smaller than a preset difference threshold value to obtain a replaced amplitude sequence, and splitting the replaced amplitude sequence into independent amplitude values and amplitude sequence segments;
and if the predicted storage space of the amplitude sequence is less than or equal to the free storage space, executing the step of splitting the amplitude sequence into independent amplitude and amplitude sequence segments.
11. A waveform generation apparatus, characterized in that the apparatus comprises:
an acquisition module: the method comprises the steps of obtaining a waveform data packet of a target waveform to be generated;
a generation module: and the target waveform is generated according to the waveform amplitude values in the waveform data packet and the number of amplitude values corresponding to each waveform amplitude value.
12. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the waveform generation method of any one of claims 1 to 7 or the waveform storage method of any one of claims 8 to 10.
13. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps in the waveform generation method of any one of claims 1 to 7 or the waveform storage method of any one of claims 8 to 10.
CN202210693457.XA 2022-06-17 2022-06-17 Waveform generation method, waveform storage device, waveform generation equipment and storage medium Active CN115079771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210693457.XA CN115079771B (en) 2022-06-17 2022-06-17 Waveform generation method, waveform storage device, waveform generation equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210693457.XA CN115079771B (en) 2022-06-17 2022-06-17 Waveform generation method, waveform storage device, waveform generation equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115079771A true CN115079771A (en) 2022-09-20
CN115079771B CN115079771B (en) 2024-04-12

Family

ID=83252989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210693457.XA Active CN115079771B (en) 2022-06-17 2022-06-17 Waveform generation method, waveform storage device, waveform generation equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115079771B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0877526A2 (en) * 1997-05-02 1998-11-11 Lsi Logic Corporation Demodulating digital video broadcast signals
US20050007447A1 (en) * 2003-01-29 2005-01-13 Xg Technology, Llc Modulation compression method for the radio frequency transmission of high speed data
CN102193106A (en) * 2010-03-18 2011-09-21 长江大学 Method for generating frequency sweeping signal special for controllable seismic source
CN108519791A (en) * 2018-04-23 2018-09-11 哈尔滨工业大学 High speed arbitrary waveform generation circuit
CN113515165A (en) * 2021-05-31 2021-10-19 阿里巴巴新加坡控股有限公司 Trigger control method and device
CN114069801A (en) * 2021-12-03 2022-02-18 西安芯海微电子科技有限公司 Quick charging connection circuit, quick charging connection device and charging control method
US11256720B1 (en) * 2021-03-23 2022-02-22 Efolder Inc. Hierarchical data structure having tiered probabilistic membership query filters

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0877526A2 (en) * 1997-05-02 1998-11-11 Lsi Logic Corporation Demodulating digital video broadcast signals
US20050007447A1 (en) * 2003-01-29 2005-01-13 Xg Technology, Llc Modulation compression method for the radio frequency transmission of high speed data
CN102193106A (en) * 2010-03-18 2011-09-21 长江大学 Method for generating frequency sweeping signal special for controllable seismic source
CN108519791A (en) * 2018-04-23 2018-09-11 哈尔滨工业大学 High speed arbitrary waveform generation circuit
US11256720B1 (en) * 2021-03-23 2022-02-22 Efolder Inc. Hierarchical data structure having tiered probabilistic membership query filters
CN113515165A (en) * 2021-05-31 2021-10-19 阿里巴巴新加坡控股有限公司 Trigger control method and device
CN114069801A (en) * 2021-12-03 2022-02-18 西安芯海微电子科技有限公司 Quick charging connection circuit, quick charging connection device and charging control method

Also Published As

Publication number Publication date
CN115079771B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
CN103593419A (en) Method, device, server and system for inquiring data
CN107481706B (en) Song skewer burning method and device
CN111090628A (en) Data processing method and device, storage medium and electronic equipment
EP3767483A1 (en) Method, device, system, and server for image retrieval, and storage medium
CN110474896A (en) Data communications method and relevant device based on Modbus consensus standard
CN110210212A (en) A kind of data processing method, device and relevant device
CN109978006B (en) Face image clustering method and device
CN111090268A (en) Data acquisition method and device based on thread division and data acquisition equipment
CN107452361B (en) Song sentence dividing method and device
CN115052041A (en) Channel identification distribution method, device, equipment and storage medium
CN110018845A (en) Metadata version control methods and device
CN112667636B (en) Index establishing method, device and storage medium
CN115079771A (en) Waveform generation method, waveform storage method, device, equipment and storage medium
CN113778455B (en) Code conversion method and device, electronic equipment and storage medium
CN115174890A (en) Flow playback test method and device, computer equipment and storage medium
CN112162964B (en) Self-adaptive data synchronization method, device, computer equipment and storage medium
CN115221060A (en) Case generation method, device and equipment based on associated field and storage medium
CN114201729A (en) Method, device and equipment for selecting matrix operation mode and storage medium
CN114968123A (en) Waveform reading method, waveform storage device and electronic equipment
CN113986828A (en) Method and device for storing mass files, electronic equipment and storage medium
CN106446261B (en) Content searching method and device based on multi-platform interface
CN110765237A (en) Document processing method, document processing device, storage medium and electronic equipment
JP2019144873A (en) Block diagram analyzer
CN117472787B (en) Test case generation method, device, medium and equipment for vehicle-mounted computer fuzzy test
CN118138786A (en) Distributed audio and video scheduling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant