Waveform reading methods, waveform storage methods, devices, electronic equipment
By acquiring waveform identifiers and address data packets, determining waveform length conversion rules, and using length parameters to replace waveform addresses for reading, the problems of excessive waveform storage space occupation and long reading time are solved, achieving more efficient waveform parsing.
Patent Information
- Application Number
- CN202210693455.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-06-17
AI Technical Summary
In waveform storage, the existing technology stores the beginning and end addresses of the waveform, which results in excessive storage space usage and long address parsing time during reading.
By receiving waveform reading instructions, the waveform identifier and address data packet of the target waveform are obtained. Based on the waveform identifier, the waveform length conversion rule is determined, and the length parameter is used to replace the waveform address for reading, thereby reducing the amount of data stored.
This reduces the storage space and reading time of waveform addresses, thus improving the efficiency of waveform parsing.
Smart Images

Figure CN114968123B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic technology, specifically to a waveform reading method, apparatus, device, storage medium, and waveform storage method. Background Technology
[0002] With the development of electronic technology, waveforms are increasingly used in electronic products, frequently representing the shape and form of signals. This includes signal transmission for functional haptic feedback and applications in numerous human-computer interaction fields. Examples include mobile phones, tablets, mobile phone / wristband devices, car dashboards, and game consoles, where stored waveform signals are read for signal transmission and feedback.
[0003] Generally, after storing a waveform signal, its storage address is associated with the storage address so that the corresponding waveform can be accurately read later. However, in the existing technology, the first and last addresses of the waveform are usually stored when storing the waveform address. When the storage space is large, it will occupy too many bytes, resulting in a lot of time being spent parsing the address when reading the storage address. Summary of the Invention
[0004] This application provides a waveform reading method, waveform storage method, apparatus, electronic device, and storage medium, which abandons the traditional method of storing the beginning and end addresses of the waveform to achieve waveform reading, reduces the amount of data stored in the waveform address, and thus reduces the waveform parsing and reading time.
[0005] Firstly, this application provides a waveform reading method, including:
[0006] Receive a waveform reading instruction and obtain the waveform identifier and address data packet of the target waveform. The address data packet includes a length parameter and a waveform address.
[0007] Based on the waveform identifier, determine the waveform length conversion rule for the target waveform;
[0008] The length value is determined based on the waveform length conversion rule and the length parameter in the address data packet;
[0009] The target waveform is read from the length value and the waveform address in the address data packet.
[0010] In one possible implementation of this application, determining the waveform length conversion rule of the target waveform based on the waveform identifier includes:
[0011] Obtain the waveform type corresponding to the target waveform identified by the waveform identifier;
[0012] If the waveform type is the first waveform type, then the first preset rule is set as the waveform length conversion rule;
[0013] If the waveform type is the second waveform type, then the second preset rule is set as the waveform length conversion rule.
[0014] In one possible implementation of this application, determining the length value based on the waveform length conversion rule and the length parameter in the address data packet includes:
[0015] If the waveform length conversion rule is the first preset rule, the length parameter in the address data packet is identified as the length value according to the first preset rule.
[0016] In one possible implementation of this application, the second preset rule includes a length identification rule and a length value calculation rule. The step of determining the length value based on the waveform length conversion rule and the length parameter in the address data packet includes:
[0017] If the waveform length conversion rule is the second preset rule, the length parameter in the address data packet is identified according to the length identification rule;
[0018] The length value is calculated based on the length parameter and the length value calculation rule.
[0019] In one possible implementation of this application, obtaining the read address of the target waveform based on the length value and the waveform address in the address data packet, and then reading it, includes:
[0020] The starting read address in the address data packet is identified according to the starting read address identification rule corresponding to the waveform identifier;
[0021] The target waveform is read from the starting read address and the length value.
[0022] In one possible implementation of this application, the length value calculation rule is to use the length parameter as the logarithm of the length value with base 2 to calculate the length value.
[0023] In one possible implementation of this application, before the steps of receiving the waveform reading instruction and obtaining the waveform identifier and address data packet of the target waveform, the method further includes:
[0024] Receive waveform storage instructions and obtain the waveform identifier of the waveform to be stored;
[0025] Store the waveform to be stored corresponding to the waveform identifier;
[0026] Obtain at least one waveform address and length value of the waveform to be stored;
[0027] If the length value is greater than a preset length value threshold, the waveform type of the waveform to be stored is confirmed to be the second waveform type;
[0028] The length value is converted to obtain the length parameter after waveform conversion, and a waveform length conversion rule corresponding to the second waveform type is established based on the conversion relationship between the length value and the length parameter.
[0029] An address data packet is generated based on the length parameter after waveform conversion and the waveform address information;
[0030] Establish the association between the waveform identifier, the address data packet, and the waveform type.
[0031] Secondly, this application provides a waveform storage method, including:
[0032] Obtain the original waveform to be stored, and the waveform identifier of the original waveform;
[0033] Based on the amplitude sequence of the original waveform, determine the length parameter and waveform type of the original waveform;
[0034] Based on the amplitude sequence, the original waveform is stored, and a waveform address is determined based on the storage address of the stored original waveform and the length parameter.
[0035] An address data packet is generated based on the length parameter and a waveform address, and the address data packet and the waveform type are associated with the waveform identifier and stored.
[0036] In one possible implementation of this application, determining the length parameter and waveform type of the original waveform based on the amplitude sequence of the original waveform includes:
[0037] Determine the number of amplitudes in the amplitude sequence of the original waveform, and determine the target length value of the original waveform based on the number of amplitudes;
[0038] If the target length value is greater than a preset threshold, the waveform identifier of the target waveform is determined to be a second waveform type;
[0039] The preset conversion relationship between the length value and the length parameter is determined based on the second waveform type, and the length parameter corresponding to the target length value is determined based on the preset conversion relationship.
[0040] Thirdly, this application provides a waveform reading device, the device comprising:
[0041] Receiving module: used to receive waveform reading instructions, obtain the waveform identifier and address data packet of the target waveform, wherein the address data packet includes a length parameter and a waveform address;
[0042] Rule determination module: used to determine the waveform length conversion rule of the target waveform based on the waveform identifier;
[0043] Wavelength confirmation module: used to determine the length value based on the waveform length conversion rule and the length parameter in the address data packet;
[0044] Reading module: used to obtain the reading address of the target waveform based on the length value and the waveform address in the address data packet, and then read it.
[0045] Fourthly, this application provides an electronic component, said electronic component comprising:
[0046] One or more processors;
[0047] Memory; and
[0048] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement any one of the waveform reading methods or any one of the waveform storage methods.
[0049] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps of any of the waveform reading methods or waveform storage methods described in the present application.
[0050] This application provides a waveform reading method, waveform storage method, apparatus, electronic device, and storage medium. By receiving a waveform reading instruction, the method obtains the waveform identifier and address data packet of the target waveform. Then, based on the waveform identifier, it determines the waveform length conversion rule of the target waveform. Next, based on the waveform length conversion rule and the length parameter in the address data packet, it determines the length value. Finally, based on the length value and the waveform address in the address data packet, it obtains the reading address of the target waveform and reads it. This method abandons the traditional approach of storing the beginning and end addresses of the waveform to achieve waveform reading. The address data packet includes a length parameter and a waveform address. Since the length parameter is shorter than the waveform address, the parsing time of the address data packet is reduced. Furthermore, determining the length value through the waveform length conversion rule allows for rapid confirmation of the length value, thereby obtaining the waveform reading address. This reduces the reading time of the waveform storage address and also reduces the storage space required for the storage address.
[0051] This application provides a waveform storage method. The method involves acquiring the original waveform to be stored and its waveform identifier; then determining the length parameter and waveform type of the original waveform based on its amplitude sequence; storing the original waveform based on the amplitude sequence; determining a waveform address based on the storage address of the stored original waveform and the length parameter; generating an address data packet based on the length parameter and the waveform address; and storing the address data packet and the waveform type associated with the waveform identifier. This method abandons the traditional method of storing the beginning and end addresses of the waveform to achieve waveform reading. The address data packet includes a length parameter and a waveform address. Since the length parameter is shorter than the waveform address, it reduces the storage space required for the storage address. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a schematic diagram of a scenario for the waveform reading method provided in an embodiment of this application;
[0054] Figure 2 This is a schematic flowchart of an embodiment of the waveform reading method provided in this application;
[0055] Figure 3 This is a schematic flowchart of an embodiment of the waveform reading method provided in this application for determining the waveform length conversion rule;
[0056] Figure 4 This is a schematic flowchart of an embodiment of the waveform reading method provided in this application for determining the length value;
[0057] Figure 5 This is a schematic flowchart of an embodiment of the waveform reading address confirmation method provided in this application.
[0058] Figure 6 This is a schematic flowchart of an embodiment of the waveform storage in the waveform reading method provided in this application;
[0059] Figure 7 This is a schematic diagram of an embodiment of the waveform reading device provided in this application;
[0060] Figure 8 A schematic flowchart of a waveform storage method provided for the implementation scheme of this application;
[0061] Figure 9 This application provides an embodiment for determining the length parameter and waveform type in one implementation of a waveform storage method.
[0062] Figure 10 This is a schematic diagram of an embodiment of the waveform storage device provided in this application.
[0063] Figure 11 This is a schematic diagram of an embodiment of the electronic device provided in this application. Detailed Implementation
[0064] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0065] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0066] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0067] This application provides a waveform reading method, apparatus, device, and computer-readable storage medium, which will be described in detail below.
[0068] The waveform reading method in this embodiment of the invention is applied to a waveform reading device, which is located in an electronic device. The electronic device is equipped with one or more processors, a memory, and one or more application programs. The one or more application programs are stored in the memory and configured to be executed by the processor to implement the waveform reading method. The electronic device can be a terminal, such as a mobile phone or a tablet computer. The electronic device can also be a server or a service cluster composed of multiple servers.
[0069] like Figure 1 As shown, Figure 1 This is a schematic diagram of a waveform reading method according to an embodiment of the present application. The waveform reading scenario in this embodiment includes an electronic device 100 (which integrates a waveform reading device). The electronic device 100 runs a computer-readable storage medium corresponding to the waveform reading to perform the waveform reading step.
[0070] Understandable Figure 1 The electrons in the waveform reading method scenario, or the devices contained in the electrons, do not constitute a limitation on the embodiments of the present invention. That is, the number or type of devices in the waveform reading method scenario, or the number or type of devices contained in each device, do not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of the present invention.
[0071] In this embodiment of the invention, the electronic device 100 is mainly used for: receiving a waveform reading instruction, obtaining the waveform identifier and address data packet of the target waveform, wherein the address data packet includes a length parameter and a waveform address; determining the waveform length conversion rule of the target waveform according to the waveform identifier; determining the length value according to the waveform length conversion rule and the length parameter in the address data packet; obtaining the reading address of the target waveform according to the length value and the waveform address in the address data packet and reading it.
[0072] In this embodiment of the invention, the electron 100 can be an independent electron, or an electronic network or cluster composed of electrons. For example, the electron 100 described in this embodiment of the invention includes, but is not limited to, a computer, a network host, a single network electron, multiple sets of network electrons, or a cloud electron composed of multiple electrons. Among them, the cloud electron is composed of a large number of computers or network electrons based on cloud computing.
[0073] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include those that are more specific to this application. Figure 1 The number of more or fewer electrons shown, or the electron network connections, for example... Figure 1 Only one electron is shown in the diagram. It is understood that the waveform reading method may also include one or more other electrons, which are not limited here. The electron 100 may also include a memory for storing data, such as waveform identifiers and address data packets.
[0074] Furthermore, in the waveform reading method scenario of this application, the electronic device 100 can be equipped with a display device, or the electronic device 100 can be connected to an external display device 200 without a built-in display device. The display device 200 is used to output the result of the waveform reading method executed in the electronic device. The electronic device 100 can access the background database 300 (the background database can be located in the local storage of the electronic device, or it can be located in the cloud). The background database 300 stores waveform reading-related information, such as waveform length conversion rules or pre-set waveform identifiers.
[0075] It should be noted that Figure 1 The schematic diagram of the waveform reading method shown is merely an example. The scenarios of the waveform reading method described in this embodiment are intended to more clearly illustrate the technical solutions of this embodiment and do not constitute a limitation on the technical solutions provided by this embodiment.
[0076] Based on the scenarios described above for waveform reading methods, an embodiment of the waveform reading method is proposed.
[0077] See Figure 2 , Figure 2 A schematic flowchart of a waveform reading method provided for the implementation scheme of this application is shown. The waveform reading method includes steps 201-204:
[0078] 201. Receive waveform reading instruction, obtain waveform identifier and address data packet of target waveform, wherein the address data packet includes length parameter and waveform address.
[0079] The target waveform is the waveform to be read, and the waveform identifier is a unique identifier for the waveform. It can be understood that there is a unique association between the waveform identifier and the waveform, that is, the corresponding waveform can be found through the waveform identifier. The waveform identifier can be a unique waveform mark, waveform code, etc.
[0080] The address data packet stores a length parameter and a waveform address. The length parameter can be a length value or a calculation parameter to obtain the length value. The waveform address can be the start storage address or end storage address of the waveform. It can be understood that the waveform read address can be quickly obtained based on the length value and the waveform address.
[0081] Wherein, the length value is the number of waveform vibration amplitudes in the target waveform. It can be understood that a waveform is composed of multiple consecutive vibration amplitudes. Specifically, when the target waveform is stored, it is stored in the storage area in sequence according to the waveform amplitude sequence. One vibration amplitude occupies one storage byte (i.e., one unit storage length). Correspondingly, the length value corresponds to the number of storage bytes.
[0082] Specifically, in the embodiments of this application, the waveform reading method is applied to electronics. The type and number of electronics are not specifically limited; that is, the electronics can be terminals or servers, for example, a mobile phone. The electronics can receive waveform reading commands through its own command receiving module, such as the touchscreen or buttons of the electronics, or through an external receiving device that is communicatively connected to the electronics, such as a mobile phone or computer that is communicatively connected to the electronics.
[0083] It is understood that the waveform reading instruction is used to trigger waveform reading and indicate the target waveform. That is, when the electronic device receives the waveform reading instruction, it starts waveform reading. It is understood that the waveform reading instruction may carry the waveform identifier of the target waveform. After receiving the waveform reading instruction, the electronic device can obtain the waveform identifier of the target waveform by parsing the instruction. Alternatively, when the electronic device receives the waveform reading instruction, it can automatically trigger the feedback of the target waveform selection to the electronic device's display interface or an external display device that is communicatively connected to the electronic device to obtain the waveform identifier of the target waveform. This application does not make specific limitations.
[0084] Specifically, after determining the waveform identifier of the target waveform, the electronic device obtains the address data packet corresponding to the target waveform based on the waveform identifier. It is understood that the address data packet can be stored in the electronic device or in an external storage device that is communicatively connected to the electronic device. It is also understood that there is a correlation between the waveform identifier and the address data packet.
[0085] 202. Determine the waveform length conversion rule of the target waveform based on the waveform identifier.
[0086] The waveform length conversion rule is used for the wavelength of the target waveform. It can be understood that the waveform length conversion rule can be preset during storage based on the actual length value. The length value is the length of bytes occupied by the waveform after storage. It can be understood that the waveform length can be the total length of the waveform or a partial storage length of the waveform, which is used to determine the waveform read address in conjunction with the waveform address in the address data packet.
[0087] Specifically, after receiving the waveform reading instruction, the electronic device obtains the waveform identifier and address data packet of the target waveform according to the waveform reading instruction, and confirms the waveform length conversion rule used to determine the length value corresponding to the waveform identifier based on the obtained waveform identifier of the target waveform.
[0088] For details, see Figure 3 In one embodiment of this application, step 202 specifically includes steps 301-303:
[0089] 301. Obtain the waveform type of the target waveform corresponding to the waveform identifier;
[0090] 302. If the waveform type is the first waveform type, then the first preset rule is set as the waveform length conversion rule;
[0091] 303. If the waveform type is the second waveform type, then the second preset rule is set as the waveform length conversion rule.
[0092] It is understandable that if the waveform type is the second waveform type, the wavelength data of the second waveform type will occupy more storage bytes. Conversely, if the waveform type is the first waveform type, the waveform length will occupy fewer storage bytes. By simplifying the waveform length of the second waveform type, fewer bytes can be occupied. It is understandable that the waveform length conversion rules for the second waveform type and the first waveform type are different.
[0093] The waveform type can be preset according to the corresponding waveform length, i.e., the length value. Specifically, for example, it can be determined by comparing with a preset waveform length judgment threshold to limit the waveform type to the second waveform type or the first waveform type, and then associated with the waveform identifier for storage.
[0094] Specifically, this application does not impose specific limitations on the method by which the electronic device determines the waveform type through the acquired waveform identifier. For example, the electronic device may look up the waveform type table based on the waveform identifier after acquiring it, or it may directly acquire it based on the communication link linked to the waveform identifier. The specific method can be adjusted according to actual needs.
[0095] 203. Determine the length value according to the waveform length conversion rule and the length parameter in the address data packet.
[0096] The length parameter is used to confirm the waveform length. It can be understood that if the waveform type is a first waveform type, the waveform length corresponding to the first waveform type is directly stored. The waveform length conversion rule is used to identify the length parameter in the address data packet without performing any restoration processing on the length parameter; that is, the waveform length is obtained directly. If the waveform type is a second waveform type, the waveform length conversion rule is used to identify the length parameter in the address data packet and perform waveform length restoration processing on the length parameter to obtain the corresponding length value. It can be understood that if the waveform type is a second waveform type, the length parameter is a simplified version of the length value, requiring simplification and restoration to obtain the corresponding length value.
[0097] For details, see Figure 4 In one embodiment of this application, step 203 specifically includes steps 401-402:
[0098] 401. If the waveform length conversion rule is a first preset rule, the length parameter in the address data packet is identified as the length value according to the first preset rule;
[0099] 402. If the waveform length conversion rule is the second preset rule, the length parameter in the address data packet is identified according to the length identification rule, and the length value is calculated according to the length parameter and the length value calculation rule.
[0100] The first preset rule is used to identify the length parameter in the address data packet, which is the length value. Specifically, the first preset rule can be a length parameter identification format template. It is understood that the address data packet includes a waveform address and a length parameter. The length parameter may also include other placeholder header parameters used for occupancy. By using the first preset rule to search for the length parameter in the address data packet, the corresponding length parameter can be found quickly and accurately. Moreover, the length parameter occupies few bytes, which can be quickly identified, thus improving the identification efficiency.
[0101] In this embodiment, the second preset rule includes a length identification rule and a length value calculation rule. The length identification rule is used to identify the length parameter in the address data packet. Specifically, in this embodiment, the length parameter is the simplified length parameter of the waveform storage address. It is understood that the simplified length parameter of the waveform storage address and the length parameter corresponding to the first waveform type are both length parameters, and their storage formats can be the same. If the simplified length parameter of the waveform storage address and the length parameter corresponding to the first waveform type have the same storage format, the length identification rule can be the same as the first preset rule; that is, the length identification rule directly calls the first preset rule. In other embodiments of this application, the storage format of the simplified length parameter of the waveform storage address and the length parameter of the first waveform type can also be different. That is, it is understood that the length identification rule corresponding to the second waveform type can be an independent length identification rule different from the first preset rule, used to identify the length parameter of the address data packet.
[0102] The length value calculation rule can be a calculation rule generated based on a simplified length value. Therefore, it can be understood that the corresponding length value can be obtained by restoring the simplified length parameter according to the length value calculation rule. For example, when the waveform type is the second waveform type, the length value is calculated using a base-2 logarithm, and the resulting logarithm is the simplified parameter for the corresponding waveform storage address. The step of calculating the length value based on the length parameter and the length value calculation rule includes: using the length parameter as the base-2 logarithm of the length value to calculate the length value. It should be understood that this is only one implementation scheme of calculating the length value based on the length parameter and the length value calculation rule in this application.
[0103] Specifically, when the electronic device confirms that the waveform type is the first waveform type, it identifies the length parameter in the address data packet as the length value according to the first preset rule. If the electronic device confirms that the waveform type is the second waveform type, it identifies the length parameter in the address data packet as the simplified length value according to the length identification rule in the second preset rule, and then calculates the length value according to the length parameter and the length value calculation rule in the second preset rule.
[0104] 204. Obtain the reading address of the target waveform based on the length value and the waveform address in the address data packet, and then read it.
[0105] The target waveform reading address includes the start address and the end address of the target waveform. That is, after obtaining the target waveform reading address, the electronic device reads the target waveform sequentially from the start address until it reaches the end address. It can be understood that during the waveform reading process, the electronic device will output the read waveform sequentially and transmit it to the lower-level operating device. For example, the electronic device will output the read waveform sequentially to the lower-level motor, and the motor will act on it to achieve the effect of motor vibration.
[0106] It is understood that this application does not specifically limit the specific implementation scheme of obtaining the reading address of the target waveform based on the length value and the waveform address in the address data packet, and reading it, for example, it includes:
[0107] One possible approach is to obtain the starting address from the address data packet, add the storage address length to the starting address to obtain the ending address, thereby confirming the reading address of the target waveform and reading the target waveform.
[0108] Another possible approach is to obtain the termination address in the address data packet, subtract the storage address length from the termination address to obtain the starting address, thereby confirming the reading address of the target waveform and reading the target waveform.
[0109] For details, see Figure 5 In one embodiment of this application, step 204 includes steps 501-502:
[0110] 501. Identify the starting read address in the address data packet according to the starting read address identification rule corresponding to the waveform identifier;
[0111] 502. Obtain the reading address of the target waveform according to the starting reading address and the length value, and read it.
[0112] Specifically, the starting address identification rule corresponding to the waveform identifier is used to read the starting address in the address data packet. It can be understood that the address data packet includes the waveform address and the length parameter. The length parameter may also include other placeholder header parameters used for placeholders. By using the starting address identification rule to search for the starting address in the address data packet, the corresponding starting address can be found quickly and accurately, thus improving the identification efficiency.
[0113] Specifically, the starting address identification rule can be stored in the electronic storage structure or in an external storage structure that is communicatively connected to the waveform storage structure, and associated with the waveform identifier.
[0114] Furthermore, based on the above implementation plan, see [link to relevant documentation]. Figure 6 The process also includes steps 601-607 before step 201:
[0115] 601. Receive waveform storage instruction and obtain the waveform identifier of the waveform to be stored;
[0116] 602. Store the waveform to be stored corresponding to the waveform identifier;
[0117] 603. Obtain at least one waveform address and length value of the waveform to be stored;
[0118] 604. If the length value is greater than a preset length value threshold, confirm that the waveform type of the waveform to be stored is the second waveform type;
[0119] 605. Convert the length value to obtain the length parameter after waveform conversion, and establish a waveform length conversion rule corresponding to the second waveform type based on the conversion relationship between the length value and the length parameter;
[0120] 606. Generate an address data packet based on the length parameter after waveform conversion and the waveform address information;
[0121] 607. Establish the association between the waveform identifier, the address data packet, and the waveform type.
[0122] It is understandable that when the waveform type is the second waveform type, its corresponding length value is a relatively long value, which will also occupy more storage space. By converting the length value, it can be simplified into a shorter length parameter, reducing storage space and data parsing time. It is understood that the conversion can be to calculate the logarithm of the length value, such as the logarithm to base 2, the logarithm to base 4, etc. The conversion can also be a number system conversion. This application does not make specific limitations on the specific conversion.
[0123] Specifically, the waveform reading instruction is used to trigger waveform storage and indicate the waveform to be read. That is, when the device receives the waveform storage instruction, it starts waveform storage. It can be understood that the waveform storage instruction may carry the waveform identifier of the target waveform. After receiving the waveform storage instruction, the waveform storage device can obtain the waveform identifier of the target waveform by parsing the instruction. Alternatively, when the waveform storage device receives the waveform storage instruction, it can automatically trigger the feedback of the target waveform to select the display interface of the waveform storage device or an external display device that is communicatively connected to the waveform storage device to obtain the waveform identifier of the target waveform. This application does not make specific limitations.
[0124] Specifically, upon receiving a waveform storage instruction, the waveform storage device obtains the waveform identifier of the waveform to be stored corresponding to the instruction, and stores the waveform according to the waveform identifier. It also obtains a waveform storage address, such as the waveform start address, waveform end address, or waveform center address, and the waveform storage length. It is understood that these parameters can be directly obtained after the waveform is stored. The device then judges the obtained length value. In this embodiment, judging the waveform storage length specifically includes:
[0125] (1) If the length value is greater than the preset length value threshold, the waveform type of the waveform to be stored is confirmed to be the second waveform type; the length value is converted to obtain the waveform converted length parameter, and a waveform length conversion rule corresponding to the second waveform type is established according to the conversion relationship between the length value and the length parameter; an address data packet is generated according to the waveform converted length parameter and the waveform address information.
[0126] (2) If the length value is less than or equal to a preset length value threshold, the waveform type of the waveform to be stored is confirmed to be the first waveform type; the length value is used as a length parameter and the waveform address information to generate an address data packet;
[0127] After determining the storage length of the waveform, the electronic system establishes an association between the waveform identifier, the address data packet, and the waveform type to achieve the storage of the waveform to be stored.
[0128] This application provides a waveform reading method. It involves receiving a waveform reading instruction, obtaining the waveform identifier and address data packet of the target waveform, then determining the waveform length conversion rule of the target waveform based on the waveform identifier; determining the length value based on the waveform length conversion rule and the length parameter in the address data packet; and finally obtaining the reading address of the target waveform based on the length value and the waveform address in the address data packet, and then reading it. This method abandons the traditional method of storing the beginning and end addresses of the waveform to achieve waveform reading. The address data packet includes a length parameter and a waveform address. Since the length parameter is shorter than the waveform address, the parsing time of the address data packet is reduced. Furthermore, determining the length value through the waveform length conversion rule allows for rapid confirmation of the length value, thereby obtaining the waveform reading address. This reduces the reading time of the waveform storage address and also reduces the storage space required for the storage address.
[0129] To better implement the waveform reading method in the embodiments of this application, a waveform reading device is also provided in the embodiments of this application, such as... Figure 7 As shown, the waveform reading device includes 701-704:
[0130] Receiver module 701: Used to receive waveform reading instructions and obtain the waveform identifier and address data packet of the target waveform;
[0131] Rule determination module 702: used to determine the waveform length conversion rule of the target waveform based on the waveform identifier;
[0132] Wavelength confirmation module 703: used to determine the length value according to the waveform length conversion rule and the length parameter in the address data packet;
[0133] Reading module 704: used to obtain the reading address of the target waveform based on the length value and the waveform address in the address data packet, and then read it.
[0134] Furthermore, in some embodiments of this application, the rule determination module 702 is used to determine the waveform length conversion rule of the target waveform based on the waveform identifier, specifically including:
[0135] Obtain the waveform type corresponding to the target waveform identified by the waveform identifier;
[0136] If the waveform type is the first waveform type, then the first preset rule is set as the waveform length conversion rule;
[0137] If the waveform type is the second waveform type, then the second preset rule is set as the waveform length conversion rule.
[0138] Furthermore, in some embodiments of this application, the wavelength confirmation module 703 is used to determine the length value according to the waveform length conversion rule and the length parameter in the address data packet, specifically including:
[0139] If the waveform length conversion rule is the first preset rule, the length parameter in the address data packet is identified as the length value according to the first preset rule.
[0140] Furthermore, in some embodiments of this application, the second preset rule includes a length identification rule and a length value calculation rule. The wavelength confirmation module 703 is used to determine the length value according to the waveform length conversion rule and the length parameter in the address data packet, specifically including:
[0141] If the waveform length conversion rule is the second preset rule, the length parameter in the address data packet is identified according to the length identification rule;
[0142] The length value is calculated based on the length parameter and the length value calculation rule.
[0143] Furthermore, in some embodiments of this application, the reading module 704 includes a function for obtaining the reading address of the target waveform based on the length value and the waveform address in the address data packet, and then reading it. Specifically, this includes:
[0144] The starting read address in the address data packet is identified according to the starting read address identification rule corresponding to the waveform identifier;
[0145] The target waveform is read from the starting read address and the length value.
[0146] Furthermore, in some embodiments of this application, the wavelength confirmation module 703 is used to calculate the length value according to the length parameter and the length value calculation rule, specifically including:
[0147] The length parameter is used as the logarithm of the length value to the base 2 to calculate the length value.
[0148] Furthermore, in some embodiments of this application, the waveform reading device further includes a storage module for:
[0149] Receive waveform storage instructions and obtain the waveform identifier of the waveform to be stored;
[0150] Store the waveform to be stored corresponding to the waveform identifier;
[0151] Obtain at least one waveform address and length value of the waveform to be stored;
[0152] If the length value is greater than a preset length value threshold, the waveform type of the waveform to be stored is confirmed to be the second waveform type;
[0153] The length value is converted to obtain the length parameter after waveform conversion, and a waveform length conversion rule corresponding to the second waveform type is established based on the conversion relationship between the length value and the length parameter.
[0154] An address data packet is generated based on the length parameter after waveform conversion and the waveform address information;
[0155] Establish the association between the waveform identifier, the address data packet, and the waveform type.
[0156] This application provides a waveform reading device that receives a waveform reading instruction, obtains the waveform identifier and address data packet of the target waveform, then determines the waveform length conversion rule of the target waveform based on the waveform identifier, determines the length value based on the waveform length conversion rule and the length parameter in the address data packet, and finally obtains and reads the reading address of the target waveform based on the length value and the waveform address in the address data packet. This method abandons the traditional method of storing the beginning and end addresses of the waveform to achieve waveform reading. The address data packet includes a length parameter and a waveform address. Since the length parameter is shorter than the waveform address, the parsing time of the address data packet is reduced. Furthermore, determining the length value through the waveform length conversion rule can quickly confirm the length value and thus obtain the waveform reading address, thereby reducing the reading time of the waveform storage address and also reducing the storage space of the storage address.
[0157] See Figure 8 , Figure 8 A schematic flowchart of a waveform storage method provided for the implementation of this application is shown. The waveform storage method includes steps 801-804:
[0158] 801. Obtain the original waveform to be stored, and the waveform identifier of the original waveform.
[0159] The original waveform is the waveform to be stored. The original waveform consists of sequentially arranged amplitude values, that is, the original waveform includes multiple amplitude values, which are arranged in order to form an amplitude value sequence.
[0160] The waveform identifier is a unique identifier for the waveform. It can be understood that there is a unique association between the waveform identifier and the waveform. That is, the corresponding waveform can be found through the waveform identifier. The waveform identifier can be a unique waveform mark, waveform code, etc.
[0161] It is understood that, specifically, the waveform storage method is applied to a waveform storage device. The type and number of waveform storage devices are not specifically limited; that is, the waveform storage device can be a terminal or a server, for example, a mobile phone. The waveform storage device can receive waveform storage instructions through its own instruction receiving module, such as the device's touchscreen or buttons, or through an external receiving device that is communicatively connected to the waveform storage device, such as a mobile phone or computer.
[0162] It is understandable that, on the one hand, the acquisition of the original waveform can be triggered after receiving a waveform storage instruction. When the waveform storage device receives the waveform storage instruction, it can obtain the waveform identifier of the target waveform by parsing the instruction, which carries the waveform identifier of the original waveform.
[0163] On the other hand, the acquisition of the original waveform can also be achieved automatically when an unstored original waveform is detected, along with the identification information of the original waveform. This application does not make any specific limitations on this.
[0164] 802. Determine the length parameter and waveform type of the original waveform based on the amplitude sequence of the original waveform.
[0165] The waveform type is determined based on the waveform length, i.e., the length value. It can be understood that the length value is the number of waveform vibration amplitudes in the amplitude sequence of the original waveform. It can be understood that a waveform consists of multiple consecutive vibration amplitudes. Specifically, when the target waveform is stored, it is stored in the storage area in sequence according to the waveform amplitude sequence. One vibration amplitude occupies one byte of storage area (i.e., one unit of storage length). Correspondingly, the length value corresponds to the number of storage bytes.
[0166] Specifically, in the embodiments of this application, the waveform type includes a first waveform type and a second waveform type. It can be understood that the waveform type can be preset according to the corresponding waveform length or length value. For example, it can be determined by comparing with a preset waveform length judgment threshold to limit the waveform type to the second waveform type or the first waveform type, and then associated with and stored with the waveform identifier.
[0167] The length parameter is used to confirm the waveform length. It can be understood that if the waveform type is a first waveform type, the waveform length corresponding to the first waveform type is directly stored as the length parameter. It can also be understood that if the waveform type is a second waveform type, the length parameter is a simplified length value, and the length parameter needs to be simplified and restored to obtain the corresponding length value.
[0168] It is understandable that if the waveform type is the second waveform type, the wavelength data of the second waveform type will occupy more storage bytes. Conversely, if the waveform type is the first waveform type, the waveform length will occupy fewer storage bytes. By simplifying the waveform length of the second waveform type, fewer bytes can be occupied. It is understandable that the waveform length conversion rules for the second waveform type and the first waveform type are different.
[0169] For details, see Figure 9 , Figure 9 To determine the length parameter and waveform type in one embodiment of the waveform storage method of this application, specific steps 901-903 are included:
[0170] 901. Determine the number of amplitudes in the amplitude sequence of the original waveform, and determine the target length value of the original waveform based on the number of amplitudes;
[0171] 902. If the target length value is greater than a preset threshold, determine that the waveform identifier of the target waveform is a second waveform type;
[0172] 903. Determine the preset conversion relationship between the length value and the length parameter according to the second waveform type, and determine the length parameter corresponding to the target length value according to the preset conversion relationship.
[0173] Specifically, the preset threshold can be the length of bytes occupied by a storage address, i.e., the number of bytes occupied.
[0174] Specifically, the preset conversion relationship can be a preset relationship, a calculation function, a mapping table, etc., used to determine the length parameter corresponding to the length value. For example, the preset relationship between the length value and length parameter corresponding to the second waveform type and the calculation rule specifically involves calculating the length parameter by performing a logarithmic operation based on the length value to the base 2. Then, the calculation of the length parameter based on the preset conversion relationship between the length value and the length parameter specifically involves using the length parameter as the logarithm of the length value to the base 2 to calculate the length parameter. It should be understood that this is only one implementation scheme of the present application for calculating the length value based on the length parameter and the length value calculation rule.
[0175] It is understood that the preset conversion relationship between the length value and the length parameter can be used as the first preset rule in the above implementation scheme to calculate the length value.
[0176] If the target length value is not greater than a preset threshold, then the length value is used as a length parameter. It can be understood that a first preset rule can be set according to the conversion relationship of the length value as a length parameter for waveform reading in the above implementation scheme. This application does not make specific limitations.
[0177] 803. Store the original waveform according to the amplitude sequence, and determine a waveform address according to the storage address of the stored original waveform and the length parameter.
[0178] It is understandable that after obtaining the original waveform, a storage location in the preset storage space that can accommodate the original waveform can be determined based on the length value of the original waveform, and the original waveform can be stored in the corresponding storage location of the preset storage space, and the storage address of the storage location can be determined.
[0179] Specifically, a waveform address is determined based on the storage address of the original waveform and the length parameter. That is, the length parameter is added to or subtracted from the waveform address, and the resulting storage address is included in the storage address of the original waveform. This facilitates the parsing of the waveform position during subsequent waveform reading. Specifically, the waveform address is the start address or the end address in the storage address of the original waveform.
[0180] 804. Generate an address data packet based on the length parameter and a waveform address, and store the address data packet and the waveform type associated with the waveform identifier.
[0181] It is understood that after obtaining the length parameter, a waveform address, and the waveform type, the waveform storage device packages the length parameter and the waveform address to generate an address data packet, and stores the address data packet and the waveform type associated with the waveform identifier.
[0182] This application provides a waveform storage method. The method involves acquiring the original waveform to be stored and its waveform identifier; then determining the length parameter and waveform type of the original waveform based on its amplitude sequence; storing the original waveform based on the amplitude sequence; determining a waveform address based on the storage address of the stored original waveform and the length parameter; generating an address data packet based on the length parameter and the waveform address; and storing the address data packet and the waveform type associated with the waveform identifier. This method abandons the traditional method of storing the beginning and end addresses of the waveform to achieve waveform reading. The address data packet includes a length parameter and a waveform address. Since the length parameter is shorter than the waveform address, it reduces the storage space required for the storage address.
[0183] To better implement the waveform storage method in the embodiments of this application, based on the waveform reading method, the embodiments of this application also provide a waveform reading device, such as... Figure 10 As shown, the waveform reading device includes modules 1001-1004:
[0184] Acquisition module 1001: used to acquire the original waveform to be stored, and the waveform identifier of the original waveform;
[0185] First processing module 1002: used to determine the length parameter and waveform type of the original waveform based on the amplitude sequence of the original waveform;
[0186] The second processing module 1003 is used to store the original waveform according to the amplitude sequence, and to determine a waveform address according to the storage address of the stored original waveform and the length parameter.
[0187] Storage module 1004: Used to generate an address data packet based on the length parameter and a waveform address, and to store the address data packet and the waveform type associated with the waveform identifier.
[0188] In one embodiment of this application, the first processing module 1002 is used to determine the length parameter and waveform type of the original waveform based on the amplitude sequence of the original waveform, specifically including: determining the number of amplitudes in the amplitude sequence of the original waveform, and determining the target length value of the original waveform based on the number of amplitudes;
[0189] If the target length value is greater than a preset threshold, the waveform identifier of the target waveform is determined to be a second waveform type;
[0190] The preset conversion relationship between the length value and the length parameter is determined based on the second waveform type, and the length parameter corresponding to the target length value is determined based on the preset conversion relationship.
[0191] This application provides a waveform storage device that acquires the original waveform to be stored and its waveform identifier; then, based on the amplitude sequence of the original waveform, determines the length parameter and waveform type of the original waveform; stores the original waveform based on the amplitude sequence, and determines a waveform address based on the storage address of the stored original waveform and the length parameter; generates an address data packet based on the length parameter and the waveform address, and stores the address data packet and the waveform type associated with the waveform identifier. This method abandons the traditional method of storing the beginning and end addresses of the waveform to achieve waveform reading. The address data packet includes a length parameter and a waveform address. Since the length parameter is shorter than the waveform address, the storage space of the storage address can be reduced.
[0192] This invention also provides an electronic, such as Figure 11 As shown, Figure 11 This is a schematic diagram of an embodiment of the electronic device provided in this application.
[0193] The electronic device integrates any of the waveform reading devices provided in the embodiments of the present invention, the electronic device comprising:
[0194] one or more processors;
[0195] Memory; and
[0196] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor in the steps of the waveform reading method in any embodiment of the above waveform reading method embodiments or in the steps of the waveform storage method in any embodiment of the above waveform reading method embodiments.
[0197] Specifically, the electronics may include components such as a processor 1101 with one or more processing cores, a memory 1102 with one or more computer-readable storage media, a power supply 1103, and an input unit 1104. Those skilled in the art will understand that... Figure 11 The electronic structure shown does not constitute a limitation on the electrons and may include more or fewer components than shown, or combinations of certain components, or different arrangements of components. Wherein:
[0198] The processor 1101 is the control center of the electronic device. It connects various parts of the device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1102, and by calling data stored in the memory 1102, thereby providing overall monitoring of the device. Optionally, the processor 1101 may include one or more processing cores; preferably, the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1101.
[0199] The memory 1102 can be used to store software programs and modules. The processor 1101 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102. The memory 1102 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the device. In addition, the memory 1102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1102 may also include a memory controller to provide the processor 1101 with access to the memory 1102.
[0200] The electronics also include a power supply 1103 that supplies power to the various components. Preferably, the power supply 1103 can be logically connected to the processor 1101 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1103 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0201] The electronics may also include an input unit 1104, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0202] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1101 in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory 1102 according to the following instructions, and the processor 1101 runs the application programs stored in the memory 1102 to realize various functions, as follows:
[0203] Receive a waveform reading instruction and obtain the waveform identifier and address data packet of the target waveform. The address data packet includes a length parameter and a waveform address.
[0204] Based on the waveform identifier, determine the waveform length conversion rule of the target waveform;
[0205] The length value is determined based on the waveform length conversion rule and the length parameter in the address data packet;
[0206] The target waveform is read from the length value and the waveform address in the address data packet.
[0207] Alternatively, the processor 1101 can run the application program stored in the memory 1102 to perform various functions, as follows:
[0208] Obtain the original waveform to be stored, and the waveform identifier of the original waveform;
[0209] Based on the amplitude sequence of the original waveform, determine the length parameter and waveform type of the original waveform;
[0210] Based on the amplitude sequence, the original waveform is stored, and a waveform address is determined based on the storage address of the stored original waveform and the length parameter.
[0211] An address data packet is generated based on the length parameter and a waveform address, and the address data packet and the waveform type are associated with the waveform identifier and stored.
[0212] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0213] Therefore, embodiments of the present invention provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the waveform reading methods provided in the embodiments of the present invention. For example, the computer program loaded by the processor can execute the following steps:
[0214] Receive a waveform reading instruction and obtain the waveform identifier and address data packet of the target waveform. The address data packet includes a length parameter and a waveform address.
[0215] Based on the waveform identifier, determine the waveform length conversion rule for the target waveform;
[0216] The length value is determined based on the waveform length conversion rule and the length parameter in the address data packet;
[0217] The target waveform is read from the length value and the waveform address in the address data packet.
[0218] Alternatively, the computer program, when loaded by the processor, can perform the following steps:
[0219] Obtain the original waveform to be stored, and the waveform identifier of the original waveform;
[0220] Based on the amplitude sequence of the original waveform, determine the length parameter and waveform type of the original waveform;
[0221] Based on the amplitude sequence, the original waveform is stored, and a waveform address is determined based on the storage address of the stored original waveform and the length parameter.
[0222] An address data packet is generated based on the length parameter and a waveform address, and the address data packet and the waveform type are associated with the waveform identifier and stored.
[0223] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0224] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0225] The waveform reading method, waveform storage method, device, electronic device, and storage medium provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A waveform reading method, characterized in that, include: Receive a waveform reading instruction and obtain the waveform identifier and address data packet of the target waveform. The address data packet includes a length parameter and a waveform address. Based on the waveform identifier, determine the waveform length conversion rule for the target waveform; The length value is determined based on the waveform length conversion rule and the length parameter in the address data packet; The target waveform is read from the length value and the waveform address in the address data packet. The step of determining the waveform length conversion rule of the target waveform based on the waveform identifier includes: Obtain the waveform type corresponding to the target waveform identified by the waveform identifier; If the waveform type is the first waveform type, then the first preset rule is set as the waveform length conversion rule; If the waveform type is the second waveform type, then the second preset rule is set as the waveform length conversion rule; The wavelength data of the second waveform type occupies more storage bytes than the wavelength data of the first waveform type. If the waveform length conversion rule is the first preset rule, the length parameter in the address data packet is identified as the length value according to the first preset rule; If the waveform length conversion rule is a second preset rule, the second preset rule includes a length identification rule and a length value calculation rule, and the length parameter in the address data packet is identified according to the length identification rule; The length value is calculated based on the length parameter and the length value calculation rule.
2. The waveform reading method according to claim 1, characterized in that, The length value is calculated by taking the length parameter as the logarithm of the length value with base 2.
3. The waveform reading method according to claim 1, characterized in that, The step of obtaining the read address of the target waveform based on the length value and the waveform address in the address data packet, and then reading it, includes: The starting read address in the address data packet is identified according to the starting read address identification rule corresponding to the waveform identifier; The target waveform is read from the starting read address and the length value.
4. The waveform reading method according to claim 1, characterized in that, Before the step of receiving the waveform reading instruction and obtaining the waveform identifier and address data packet of the target waveform, the method further includes: Receive waveform storage instructions and obtain the waveform identifier of the waveform to be stored; Store the waveform to be stored corresponding to the waveform identifier; Obtain the waveform address information and length value of the waveform to be stored; If the length value is greater than a preset length value threshold, the waveform type of the waveform to be stored is confirmed to be the second waveform type; The length value is converted to obtain the length parameter after waveform conversion, and a waveform length conversion rule corresponding to the second waveform type is established based on the conversion relationship between the length value and the length parameter. An address data packet is generated based on the length parameter after waveform conversion and the waveform address information; If the length value is less than or equal to a preset length value threshold, the waveform type of the waveform to be stored is confirmed to be the first waveform type; The length value is used as a length parameter and the waveform address information to generate an address data packet; Establish the association between the waveform identifier, the address data packet, and the waveform type.
5. A waveform storage method, characterized in that, include: Obtain the original waveform to be stored, and the waveform identifier of the original waveform; Based on the amplitude sequence of the original waveform, determine the length parameter and waveform type of the original waveform; Based on the amplitude sequence, the original waveform is stored, and a waveform address is determined based on the storage address of the stored original waveform and the length parameter. An address data packet is generated based on the length parameter and a waveform address, and the address data packet and the waveform type are associated with the waveform identifier and stored. The step of determining the length parameter and waveform type of the original waveform based on the amplitude sequence of the original waveform includes: Determine the number of amplitudes in the amplitude sequence of the original waveform, and determine the target length value of the original waveform based on the number of amplitudes; If the target length value is greater than a preset threshold, the waveform identifier of the original waveform is determined to be the second waveform type; otherwise, the waveform identifier of the original waveform is determined to be the first waveform type. The preset conversion relationship between the length value and the length parameter is determined according to the second waveform type, and the length parameter corresponding to the target length value is determined according to the preset conversion relationship; The waveform identifier of the original waveform is determined to be the first waveform type, and the length value is used as the length parameter; The wavelength data of the second waveform type occupies more storage bytes than the wavelength data of the first waveform type.
6. A waveform reading device, characterized in that, The device includes: Receiving module: used to receive waveform reading instructions, obtain the waveform identifier and address data packet of the target waveform, wherein the address data packet includes a length parameter and a waveform address; Rule determination module: used to determine the waveform length conversion rule of the target waveform based on the waveform identifier; Wavelength confirmation module: used to determine the length value based on the waveform length conversion rule and the length parameter in the address data packet; Reading module: used to obtain the reading address of the target waveform based on the length value and the waveform address in the address data packet, and then read it; The step of determining the waveform length conversion rule of the target waveform based on the waveform identifier includes: Obtain the waveform type corresponding to the target waveform identified by the waveform identifier; If the waveform type is the first waveform type, then the first preset rule is set as the waveform length conversion rule; If the waveform type is the second waveform type, then the second preset rule is set as the waveform length conversion rule; The wavelength data of the second waveform type occupies more storage bytes than the wavelength data of the first waveform type. If the waveform length conversion rule is the first preset rule, the length parameter in the address data packet is identified as the length value according to the first preset rule; If the waveform length conversion rule is a second preset rule, the second preset rule includes a length identification rule and a length value calculation rule, and the length parameter in the address data packet is identified according to the length identification rule; The length value is calculated based on the length parameter and the length value calculation rule.
7. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the waveform reading method of any one of claims 1 to 4 or the waveform storage method of claim 5.
8. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps of the waveform reading method according to any one of claims 1 to 4 or the waveform storage method according to claim 5.
Citation Information
Patent Citations
Caching processing method and device
CN103838679A
Data compression, coding and decompression method and device, electronic equipment and storage medium
CN113630125A