Data conversion method and system based on event driving

By adopting an event-driven method in data conversion, using hashing algorithms and blockchain technology, combined with partitioning strategies, large-scale data conversion efficiency and security issues are solved, and efficient and secure data conversion is achieved.

CN119759909AActive Publication Date: 2025-04-04GUANGDONG SICHUANG ZHILIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411896343.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-04
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art requires a large amount of computing resources and time when converting large-scale data, which affects the system response time and overall efficiency, and it is difficult to ensure the confidentiality, integrity and availability of data.

Method used

The event-driven data conversion method is adopted, and the data is calculated and stored in the blockchain through a hashing algorithm. The data is partitioned and converted according to the preset partitioning strategy to ensure the security and efficiency of the data.

Benefits of technology

Improve data conversion efficiency, ensure the security of data conversion, ensure data confidentiality, integrity and availability, and avoid system lag or crash.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759909A_ABST
    Figure CN119759909A_ABST
Patent Text Reader

Abstract

The invention discloses a data conversion method and system based on event driving, and the method comprises the steps: receiving data uploaded from preset input interfaces of a plurality of clients, obtaining to-be-converted data corresponding to each client, carrying out the calculation of each to-be-converted data through a Hash algorithm, obtaining a Hash value of the to-be-converted data, and carrying out the calculation of the Hash value of the to-be-converted data. Storing the hash value and the to-be-converted data in a block chain; according to a preset partition strategy, keys and key values are distributed to all the to-be-converted data, the key values of all the to-be-converted data are stored in corresponding partitions based on the keys, multiple sets of data are obtained, the key values of the to-be-converted data in all the sets are sent to corresponding identification analysis modules to be converted, and conversion results are obtained; and the conversion result is sent to the corresponding consumption end, so that the user can check the conversion result at the consumption end. According to the method, the data is partitioned and then converted according to the partitioning strategy, so that the data conversion efficiency is improved, and the data conversion security is also ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer file processing, and in particular to an event-driven data conversion method and system. Background Art

[0002] In today's industrial field, data conversion between different industrial systems is crucial. With the continuous development of science and technology, the independent operation of each industrial system can no longer meet the needs of efficient production and management. Different industrial systems are like independent islands, and data conversion is the bridge connecting these islands. Through effective data conversion, smooth transmission and sharing of information can be achieved, breaking down barriers between systems.

[0003] However, since different systems may use different data formats, such as XML, JSON, CSV, etc., there are incompatibility issues between data formats. The commonly used technology at present is to convert and unify data in different formats by developing special data conversion tools or interfaces. The second is to use advanced data conversion technologies and tools, such as data integration platforms, ETL (Extract, Transform, Load) tools, etc., to improve the efficiency and accuracy of data conversion. However, when facing large-scale data conversion, a lot of computing resources and time are required, especially when the amount of data is huge and the conversion logic is complex, which may affect the response time and overall efficiency of the system, and may even cause the system to freeze or crash. In addition, the confidentiality, integrity and availability of the data cannot be ensured, and the data is easily leaked and tampered with. Summary of the invention

[0004] In order to solve the above technical problems, an embodiment of the present invention provides an event-driven data conversion method and system, which improves data conversion efficiency and ensures data conversion security by partitioning data according to a partitioning strategy and then converting it.

[0005] A first aspect of an embodiment of the present invention provides an event-driven data conversion method, the method comprising: Receiving data uploaded from input interfaces of a plurality of pre-set clients, and obtaining data to be converted corresponding to each client; Using the hash algorithm, each data to be converted is calculated to obtain the hash value of the data to be converted, and the hash value and the data to be converted are stored in the blockchain; According to a preset partitioning strategy, keys and key values ​​are assigned to each data to be converted, and based on the key, the key values ​​of each data to be converted are stored in a corresponding partition to obtain multiple groups of data, wherein each group of conversion data includes multiple key values ​​of the data to be converted; The key value of the data to be converted in each group is sent to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted to obtain a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy to obtain a conversion result, and sends the conversion result to the corresponding consumer end, so that the user can view the conversion result at the consumer end.

[0006] In a possible implementation of the first aspect, using a hash algorithm to calculate each data to be converted to obtain a hash value of the data to be converted includes: Convert the data to be converted into binary code to obtain the binary code of the data to be converted; Information is extracted from the binary code to obtain a fixed identifier of the data to be converted, and the fixed identifier is calculated using a hash algorithm to obtain a hash value of the data to be converted, wherein the fixed identifier is composed of the 1st to 10th bytes and the Nth to N-10th bytes in the binary code, and N is an integer greater than or equal to 1.

[0007] In a possible implementation manner of the first aspect, allocating a key and a key value to each of the to-be-converted data according to a preset partitioning strategy includes: When the data type of the data to be converted is text data, the string key is used as the key of the data to be converted, and the feature vector of the text data is extracted, and the feature vector is used as the key value; When the data type of the data to be converted is numerical data, the numerical key is used as the key of the data to be converted, and the actual numerical value is used as the key value, wherein the numerical key includes an integer key and a floating-point key; When the data type of the data to be converted is picture data or video data, the timestamp of the picture data or video data is used as the key, and the image distribution features of the picture data or video data are extracted using the improved extraction algorithm, and the image distribution features are used as the key value of the data to be converted.

[0008] In a possible implementation of the first aspect, using the improved extraction algorithm to calculate image distribution features of picture data or video data includes: Perform Gaussian blurring of multiple scales on image data or video data to obtain images of multiple scales; The images of each scale are arranged in order from small to large according to the scale size, from the upper layer to the lower layer to form a Gaussian pyramid, wherein the Gaussian pyramid includes multiple groups, and each group includes images of the corresponding scale; Compare the values ​​of each pixel in the image of each group with the adjacent pixel in the previous and next layers of the Gaussian pyramid. If the pixel is a maximum point or a minimum point, the pixel is determined to be a feature point, and multiple feature points are obtained. Calculate the gradient magnitude and direction of the image according to each feature point to obtain multiple gradient magnitudes and directions, obtain a gradient direction histogram according to each gradient magnitude and direction, and determine the key point according to the gradient direction histogram; Taking the key point as the center, a neighborhood of a preset area is obtained, the neighborhood is evenly divided into multiple sub-neighborhoods, and the gradient direction histogram of each sub-neighborhood is calculated to obtain multiple sub-gradient direction histograms; According to each sub-gradient direction histogram, the image distribution characteristics of the picture data or the video data are obtained.

[0009] In a possible implementation of the first aspect, converting the data to be converted according to a set conversion strategy to obtain a conversion result includes: Convert the data to be converted into a string type, and use the string function to convert the data to be converted whose key is not a string value to obtain the conversion result; The data to be converted is converted into a numeric type, and the parseInt function is used to extract the numeric value in the data to be converted whose key is a string value, to obtain an extraction result, and the extraction result is determined as the conversion result; If the key of the data to be converted is not a string value or a numerical value, the string function is used to convert the data to be converted into a string type to obtain string data, and the parseInt function is used to extract the numerical value in the string data to obtain the conversion result.

[0010] In a possible implementation manner of the first aspect, converting the data to be converted according to the set conversion strategy to obtain a conversion result further includes: When converting the data to be converted whose key value is a floating-point key to an integer key, the preset conversion formula is used for conversion, where the preset conversion formula is:

[0011] In the formula, b represents the converted data, and a represents the data to be converted whose key value is a floating-point type.

[0012] In a possible implementation manner of the first aspect, when enabling a user to view the conversion result at a consumption end, the method further includes: Obtain the binary code of the conversion result, and calculate the hash value to be checked according to the binary code; It is determined whether the hash value to be checked is the same as the hash value of the conversion result. If they are the same, it is determined that the conversion result is a correct conversion result.

[0013] A second aspect of an embodiment of the present invention provides an event-driven data conversion system, comprising: A receiving module, used to receive data uploaded from input interfaces of a plurality of pre-set clients, and obtain data to be converted corresponding to each of the clients; A calculation module is used to calculate each data to be converted by using a hash algorithm to obtain a hash value of the data to be converted, and store the hash value and the data to be converted in the blockchain; A partitioning module is used to assign keys and key values ​​to each data to be converted according to a preset partitioning strategy, and based on the key, store the key value of each data to be converted into a corresponding partition to obtain multiple groups of data, wherein each group of conversion data includes multiple key values ​​of the data to be converted; The conversion module is used to send the key value of the data to be converted in each group to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted to obtain a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy to obtain a conversion result, and sends the conversion result to the corresponding consumer end, so that the user can view the conversion result at the consumer end.

[0014] In a possible implementation manner of the second aspect, the computing module includes a binary code conversion unit and an extraction unit. The binary code conversion unit is used to convert the data to be converted into binary code to obtain the binary code of the data to be converted; The extraction unit is used to extract information from the binary code to obtain a fixed identifier of the data to be converted, and calculate the fixed identifier using a hash algorithm to obtain a hash value of the data to be converted, wherein the fixed identifier is composed of the 1st to 10th bytes and the Nth to N-10th bytes in the binary code, and N is an integer greater than or equal to 1.

[0015] In a possible implementation manner of the second aspect, the partitioning module includes a first partitioning unit, a second partitioning unit, and a third partitioning unit. The first partitioning unit is used for, when the data type of the data to be converted is text data, using the string key as the key of the data to be converted, extracting the feature vector of the text data, and using the feature vector as the key; The second partition unit is used for, when the data type of the data to be converted is numerical data, using the numerical key as the key of the data to be converted and the actual numerical value as the key value, wherein the numerical key includes an integer key and a floating point key; The third partitioning unit is used to use the timestamp of the picture or video data as a key when the data type of the data to be converted is picture data or video data, and utilize the improved extraction algorithm to extract the image distribution characteristics of the picture data or video data, and use the image distribution characteristics as the key value of the data to be converted.

[0016] The event-driven data conversion method proposed by the present invention receives data uploaded from the input interface of multiple clients set in advance, obtains the data to be converted corresponding to each client, calculates each data to be converted by using a hash algorithm, obtains the hash value of the data to be converted, and stores the hash value and the data to be converted in a blockchain; according to a preset partitioning strategy, assigns keys and key values ​​to each data to be converted, stores the key values ​​of each data to be converted in a corresponding partition based on the key, and obtains multiple groups of data, wherein each group of conversion data includes multiple key values ​​of the data to be converted; sends the key values ​​of the data to be converted in each group to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted, obtains a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy, obtains a conversion result, and sends the conversion result to the corresponding consumer end, so that the user can view the conversion result at the consumer end. The above method improves the data conversion efficiency and also ensures the data conversion security by partitioning the data according to the partitioning strategy and then converting it. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 : A conversion method flow chart of an embodiment of the event-driven data conversion method provided by the present invention; Figure 2 : A system block diagram of an embodiment of the event-driven data conversion method provided by the present invention. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] It will be understood that, although the terms first, second, third, etc. may be used herein to describe various elements, components and / or parts, these elements, components and / or parts should not be limited by these terms.

[0020] Please refer to Figure 1, which is a flow chart of an embodiment of the event-driven data conversion method provided by an embodiment of the present invention, including steps S101 to S104, each of which is specifically as follows: S101, receiving data uploaded from input interfaces of a plurality of preset clients, and obtaining data to be converted corresponding to each client.

[0021] In this embodiment, the user inputs freight data on the input interface of different freight system clients and uploads the freight data to the control system. The system receives data uploaded from the input interfaces of multiple pre-set clients. The freight data includes various types of data such as text data, digital data, image data, audio data, video data, etc. The format of the freight data includes but is not limited to text format, image format, audio format, video format, database format, spreadsheet format, 3D graphic format and map format.

[0022] It is worth mentioning that the data to be converted refers to the freight data uploaded to the control system.

[0023] S102: Calculate each data to be converted using a hash algorithm to obtain a hash value of the data to be converted, and store the hash value and the data to be converted in the blockchain.

[0024] In this embodiment, different systems may use different data formats, such as XML, JSON, CSV, etc. When converting and unifying data in different formats by developing special data conversion tools or interfaces, data security is also an important consideration. During the data conversion process, the confidentiality, integrity and availability of the data must be ensured to prevent data leakage and tampering.

[0025] After receiving data uploaded by different clients, each data to be converted is calculated by using a hash algorithm to obtain a hash value of the data to be converted, and then the obtained hash value and the data to be converted are stored in the blockchain, so that the converted data to be converted can be verified later to determine whether the converted data to be converted has been tampered with.

[0026] In some embodiments, the step S102 of "using a hash algorithm to calculate each of the data to be converted to obtain a hash value of the data to be converted" includes but is not limited to the following steps: Convert the data to be converted into binary code to obtain the binary code of the data to be converted; Information is extracted from the binary code to obtain a fixed identifier of the data to be converted, and the fixed identifier is calculated using a hash algorithm to obtain a hash value of the data to be converted, wherein the fixed identifier is composed of the 1st to 10th bytes and the Nth to N-10th bytes in the binary code, and N is an integer greater than or equal to 1.

[0027] In this embodiment, the hash algorithm can map a binary value string of any length to a binary value string of fixed length, and the binary value string obtained after the original data is mapped is the hash value. However, since the hash value cannot be reversed to deduce the original data, it is necessary to ensure that the input data remains unchanged.

[0028] Therefore, the data to be converted is first converted into binary code to obtain the binary code of the data to be converted, and then the first 10 bytes and the last 10 bytes of the binary code are extracted, and the first 10 bytes and the last 10 bytes are combined as a fixed identifier of the data to be converted, and then the hash algorithm is used to map the fixed identifier into a hash value of a fixed length to obtain the hash value of the data to be converted.

[0029] S103. According to a preset partitioning strategy, keys and key values ​​are assigned to each data to be converted. Based on the key, the key value of each data to be converted is stored in a corresponding partition to obtain multiple groups of data, wherein each group of conversion data includes multiple key values ​​of the data to be converted.

[0030] In this embodiment, according to a pre-set partitioning strategy, keys and key values ​​are assigned to each data to be converted, and based on the key, each data to be converted is stored in a corresponding partition, each partition includes multiple key values ​​of the same type of conversion data, wherein the same type of conversion data included in each partition comes from different clients.

[0031] It is worth mentioning that a key refers to an identifier used to uniquely identify a data item or element. It is like a label used to point to specific data, and the key value is the data content corresponding to the key. It is the actual information associated with the key.

[0032] In some embodiments, the step S103 of “allocating keys and key values ​​to the data to be converted according to a preset partitioning strategy” includes but is not limited to the following steps: When the data type of the data to be converted is text data, the string key is used as the key of the data to be converted, and the feature vector of the text data is extracted, and the feature vector is used as the key value; When the data type of the data to be converted is numerical data, the numerical key is used as the key of the data to be converted, and the actual numerical value is used as the key value, wherein the numerical key includes an integer key and a floating-point key; When the data type of the data to be converted is picture data or video data, the timestamp of the picture data or video data is used as the key, and the image distribution features of the picture data or video data are extracted using the improved extraction algorithm, and the image distribution features are used as the key value of the data to be converted.

[0033] In this embodiment, when converting different data formats from different data sources, such as XML, JSON, CSV, database-specific formats, etc., a lot of time and effort is required to deal with format differences during the conversion process. For example, when converting data in a CSV file to JSON format for a specific application, it may be necessary to write complex scripts or use special conversion tools. Moreover, some formats may have specific structural requirements or restrictions, further increasing the difficulty of conversion. Therefore, by classifying the data according to the type of each data, dividing it into different areas, and then converting the data in the same format, the conversion time can be effectively reduced, and because the data types include text data, digital data, image data, audio data, video data and other types of data, Key-value pairs are usually used to represent a mapping relationship. Key values ​​can be of many types, including integer types, such as int, long, etc., which can be used as key values. For example, when writing a program to store data in a database, you can use integers as HashMap keys to store and retrieve corresponding values; floating-point types, such as float and double. Character types, such as char. A single character can be used as a key to store related information. String types, because strings can clearly express the meaning of the key and are easy to compare and operate.

[0034] Therefore, if the data to be converted, that is, the freight data, is digital data, then its key is a numerical key, wherein the numerical key includes an integer key and a floating point key. When the freight data is text data, its key value is a string value key. For image and video data, the key value can be determined according to the specific application scenario. When the type of freight data is image data or video data, the image distribution features of the image or video data are calculated and used as the key value. After obtaining the key value of each data to be converted, it is determined whether the data to be converted has a partition corresponding to the key. If so, the key value of the data to be converted is stored in the corresponding partition. If not, the key value of the data to be converted is stored in the spare partition to obtain multiple groups of data.

[0035] In some embodiments, the step S103 of "using the improved extraction algorithm to calculate the image distribution characteristics of the picture data or video data" includes but is not limited to the following steps: Performing Gaussian blurring of multiple scales on frame images in picture data or video data to obtain images of multiple scales; The images of each scale are arranged in order from small to large according to the scale size, from the upper layer to the lower layer to form a Gaussian pyramid, wherein the Gaussian pyramid includes multiple groups, and each group includes images of the corresponding scale; Compare the values ​​of each pixel in the image of each group with the adjacent pixel in the previous and next layers of the Gaussian pyramid. If the pixel is a maximum point or a minimum point, the pixel is determined to be a feature point, and multiple feature points are obtained. Calculate the gradient magnitude and direction of the image according to each feature point to obtain multiple gradient magnitudes and directions, obtain a gradient direction histogram according to each gradient magnitude and direction, and determine the key point according to the gradient direction histogram; Taking the key point as the center, a neighborhood of a preset area is obtained, the neighborhood is evenly divided into multiple sub-neighborhoods, and the gradient direction histogram of each sub-neighborhood is calculated to obtain multiple sub-gradient direction histograms; According to each sub-gradient direction histogram, the image distribution characteristics of the picture data or the video data are obtained.

[0036] In this embodiment, a multi-scale space is constructed by performing Gaussian blurring of different scales on image data or video data. Gaussian blurring is performed using different standard deviations σ. The larger the σ, the blurrier the image and the larger the scale. Images of different scales are then formed into a Gaussian pyramid and divided into different groups, each of which has image layers of different scales. In each group of the Gaussian pyramid, the values ​​of each pixel and its adjacent pixels at different scales are compared. Adjacent pixels include adjacent pixels of the same scale and corresponding position pixels of upper and lower adjacent scales. If the value of the pixel is a local maximum or minimum, it is marked as a potential feature point.

[0037] More accurate positioning of detected potential feature points. The precise position and scale of key points in the feature points are determined by fitting a three-dimensional quadratic function, and then the key points with low contrast and edge response points are removed to improve the stability of the feature points. The initial key points are obtained. For each initial key point, the gradient amplitude and direction of the image are calculated in its neighborhood to obtain the gradient direction histogram. The main direction of the key point is determined based on the gradient direction histogram. The direction corresponding to the peak value in the histogram is usually taken as the main direction of the key point.

[0038] Taking the key point as the center, take a neighborhood of a certain size, divide the neighborhood into several sub-regions evenly, and calculate the gradient direction histogram in each sub-region. Combine these histograms to form a high-dimensional feature descriptor, which is used to describe the local features of the key point, that is, the image distribution features. The image distribution features are used as the key value of the data to be converted.

[0039] S104. Send the key value of the data to be converted in each group to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted to obtain a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy to obtain a conversion result, and sends the conversion result to the corresponding consumer end, so that the user can view the conversion result at the consumer end.

[0040] In this embodiment, after partitioning each data to be converted, the key value of the data to be converted in each zone is sent to the corresponding identification resolution module. The identification resolution module uses the identification unit to identify the port address of the data to be converted, and obtains the port address identification result of each data to be converted. Then, based on the port address identification result, the key value of the data to be converted is sent to the corresponding conversion queue. The conversion unit in the conversion queue converts the key value of the data to be converted according to the set conversion strategy, obtains the conversion result, and sends the conversion result to the corresponding consumer end so that the user can view the conversion result at the consumer end.

[0041] Before sending the key of each group of converted data to the corresponding identification resolution module, the key value in each group stops storing after reaching a preset capacity and starts sending to the corresponding identification resolution module.

[0042] In some embodiments, the step S104 of “converting the data to be converted according to the set conversion strategy to obtain a conversion result” includes but is not limited to the following steps: Convert the data to be converted into a string type, and use the string function to convert the data to be converted whose key is not a string value to obtain the conversion result; The data to be converted is converted into a numeric type, and the parseInt function is used to extract the numeric value in the data to be converted whose key is a string value, to obtain an extraction result, and the extraction result is determined to be the conversion result; If the key of the data to be converted is not a string value or a numerical value, the string function is used to convert the data to be converted into a string type to obtain string data, and the parseInt function is used to extract the numerical value in the string data to obtain the conversion result.

[0043] In this embodiment, the data to be converted is converted into a string type, and the string function is used to convert the data to be converted whose key value is not a string value to obtain a conversion result, for example, String s = "" + i, i represents a variable of type int.

[0044] The data to be converted is converted into a numeric type, and the parseInt function is used to extract the numeric value in the data to be converted whose key value is a string value, to obtain the extraction result, and the extraction result is determined to be the conversion result. If the key value of the data to be converted is not a string value or a numeric value, the string function is used to convert the data to be converted into a string type to obtain string data, and the parseInt function is used to extract the numeric value in the string data to obtain the conversion result.

[0045] It should be noted that when the parseInt function parses a string, it will return a number when it encounters a number.

[0046] In some embodiments, the step S104 of “converting the data to be converted according to the set conversion strategy to obtain a conversion result” includes but is not limited to the following steps: When the data to be converted whose key value is a floating-point key is converted to an integer key, the conversion is performed using a preset conversion formula, where the preset conversion formula is:

[0047] In the formula, b represents the converted data, and a represents the data to be converted whose key value is a floating-point type.

[0048] In this embodiment, when converting an integer whose key value is a floating-point type to an integer, the number to be converted can be explicitly converted using a forced type conversion operator. However, since this may result in data loss or reduced precision, the conversion formula is written as follows when performing the conversion:

[0049] In the formula, b represents the converted data, and a represents the data to be converted whose key value is a floating-point type.

[0050] The accuracy of the conversion result can be further guaranteed by the above conversion formula.

[0051] In some embodiments, the step S105 of “when enabling the user to view the conversion result at the consumer end” includes but is not limited to the following steps: Obtain the binary code of the conversion result, and calculate the hash value to be checked according to the binary code; It is determined whether the hash value to be checked is the same as the hash value of the conversion result. If they are the same, it is determined that the conversion result is a correct conversion result.

[0052] In this embodiment, the binary code of the conversion result is obtained, and then a hash algorithm is used to calculate a hash value to be checked based on the binary code to determine whether the hash value to be checked is the same as the hash value of the conversion result. If they are the same, the conversion result is determined to be a correct conversion result.

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

[0054] In some embodiments, Figure 2 As shown, it shows a block diagram of an event-driven data conversion system 200 provided in an embodiment of the present application, including: a receiving module 201, a calculation module 202, a partitioning module 203 and a conversion module 204, wherein: The receiving module 201 is used to receive data uploaded from input interfaces of a plurality of pre-set clients, and obtain the data to be converted corresponding to each client; The calculation module 202 is used to calculate each data to be converted by using a hash algorithm to obtain a hash value of the data to be converted, and store the hash value and the data to be converted in the blockchain; A partitioning module 203 is used to assign keys and key values ​​to each data to be converted according to a preset partitioning strategy, and store the key values ​​of each data to be converted into a corresponding partition based on the key to obtain multiple groups of data, wherein each group of converted data includes multiple key values ​​of the data to be converted; The conversion module 204 is used to send the key value of the data to be converted in each group to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted to obtain a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy to obtain a conversion result, and sends the conversion result to the corresponding consumer end, so that the user can view the conversion result at the consumer end.

[0055] In some embodiments, the computing module includes a binary code conversion unit and an extraction unit, The binary code conversion unit is used to perform binary code conversion on the data to be converted to obtain the binary code of the data to be converted; The extraction unit is used to extract information from the binary code to obtain a fixed identifier of the data to be converted, and calculate the fixed identifier using a hash algorithm to obtain a hash value of the data to be converted, wherein the fixed identifier is composed of the 1st to 10th bytes and the Nth to N-10th bytes in the binary code, and N is an integer greater than or equal to 1.

[0056] In some embodiments, the partition module includes a first partition unit, a second partition unit, and a third partition unit. The first partitioning unit is used for, when the data type of the data to be converted is text data, using the string key as the key of the data to be converted, extracting the feature vector of the text data, and using the feature vector as the key value; The second partition unit is used for, when the data type of the data to be converted is numerical data, using the numerical key as the key of the data to be converted and the actual numerical value as the key value, wherein the numerical key includes an integer key and a floating point key; The third partitioning unit is used to use the timestamp of the picture or video data as a key when the data type of the data to be converted is picture data or video data, and utilize the improved extraction algorithm to extract the image distribution characteristics of the picture data or video data, and use the image distribution characteristics as the key value of the data to be converted.

[0057] In some embodiments, the image distribution features of the picture data or video data are calculated using the improved extraction algorithm, including: Performing Gaussian blurring of multiple scales on frame images in picture data or video data to obtain images of multiple scales; The images of each scale are arranged in order from small to large according to the scale size, from the upper layer to the lower layer to form a Gaussian pyramid, wherein the Gaussian pyramid includes multiple groups, and each group includes images of the corresponding scale; Compare the values ​​of each pixel in the image of each group with the adjacent pixel in the previous and next layers of the Gaussian pyramid. If the pixel is a maximum point or a minimum point, the pixel is determined to be a feature point, and multiple feature points are obtained. Calculate the gradient magnitude and direction of the image according to each feature point to obtain multiple gradient magnitudes and directions, obtain a gradient direction histogram according to each gradient magnitude and direction, and determine the key point according to the gradient direction histogram; Taking the key point as the center, a neighborhood of a preset area is obtained, the neighborhood is evenly divided into multiple sub-neighborhoods, and the gradient direction histogram of each sub-neighborhood is calculated to obtain multiple sub-gradient direction histograms; According to each sub-gradient direction histogram, the image distribution characteristics of the picture data or the video data are obtained.

[0058] In some embodiments, the data to be converted is converted according to the set conversion strategy to obtain a conversion result, including: Convert the data to be converted into a string type, and use the string function to convert the data to be converted whose key is not a string value to obtain the conversion result; The data to be converted is converted into a numeric type, and the parseInt function is used to extract the numeric value in the data to be converted whose key is a string value, to obtain an extraction result, and the extraction result is determined to be the conversion result; If the key of the data to be converted is not a string value or a numerical value, the string function is used to convert the data to be converted into a string type to obtain string data, and the parseInt function is used to extract the numerical value in the string data to obtain the conversion result.

[0059] In some embodiments, according to the set conversion strategy, converting the data to be converted to obtain the conversion result also includes: When the data to be converted whose key value is a floating-point key is converted to an integer key, the conversion is performed using a preset conversion formula, where the preset conversion formula is:

[0060] In the formula, b represents the converted data, and a represents the data to be converted whose key value is a floating-point type.

[0061] In some embodiments, when enabling the user to view the conversion result at the consumer end, the process further includes: Obtain the binary code of the conversion result, and calculate the hash value to be checked according to the binary code; It is determined whether the hash value to be checked is the same as the hash value of the conversion result. If they are the same, it is determined that the conversion result is a correct conversion result.

[0062] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0063] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data conversion method based on event-driven, characterized in that: include: Receiving data uploaded from input interfaces of a plurality of pre-set clients, and obtaining data to be converted corresponding to each of the clients; Using a hash algorithm, each of the data to be converted is calculated to obtain a hash value of the data to be converted, and the hash value and the data to be converted are stored in a blockchain; According to a preset partitioning strategy, keys and key values ​​are assigned to each of the data to be converted, and based on the keys, the key values ​​of each of the data to be converted are stored in corresponding partitions to obtain multiple groups of data, wherein each group of conversion data includes multiple key values ​​of the data to be converted; The key value of the data to be converted in each group is sent to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted to obtain a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy to obtain a conversion result, and sends the conversion result to the corresponding consumer end, so that the user at the consumer end can view the conversion result.

2. The event-driven data conversion method according to claim 1, characterized in that: The method of using a hash algorithm to calculate each of the data to be converted to obtain a hash value of the data to be converted includes: Convert the data to be converted into binary code to obtain the binary code of the data to be converted; Information is extracted from the binary code to obtain a fixed identifier of the data to be converted, and the fixed identifier is calculated using a hash algorithm to obtain a hash value of the data to be converted, wherein the fixed identifier is composed of the 1st to 10th bytes and the Nth to N-10th bytes in the binary code, and N is an integer greater than or equal to 1.

3. The event-driven data conversion method according to claim 1, characterized in that: The allocating keys and key values ​​to the data to be converted according to the preset partition strategy includes: When the data type of the data to be converted is text data, the string key is used as the key of the data to be converted, and a feature vector of the text data is extracted, and the feature vector is used as the key value; When the data type of the data to be converted is numerical data, the numerical key is used as the key of the data to be converted, and the actual numerical value is used as the key value, wherein the numerical key includes an integer key and a floating-point key; When the data type of the data to be converted is picture data or video data, the timestamp of the picture data or video data is used as the key, and the image distribution characteristics of the picture data or video data are extracted using the improved extraction algorithm, and the image distribution characteristics are used as the key value of the data to be converted.

4. The event-driven data conversion method according to claim 3, characterized in that: The improved extraction algorithm is used to calculate the image distribution characteristics of the picture data or video data, including: Performing Gaussian blurring of multiple scales on the frame images in the picture data or video data to obtain images of multiple scales; Arrange the images of each scale in order from small to large according to the scale size, from upper layer to lower layer to form a Gaussian pyramid, wherein the Gaussian pyramid includes a plurality of groups, and each group includes the images of the corresponding scale; Compare the values ​​of each pixel point in the image in each group with the adjacent pixel points in the previous layer and the next layer of the Gaussian pyramid, and if the pixel point is a maximum point or a minimum point, determine the pixel point as a feature point, and obtain multiple feature points; Calculating the gradient magnitude and direction of the image according to each of the feature points to obtain a plurality of the gradient magnitudes and the directions, obtaining a gradient direction histogram according to each of the gradient magnitudes and the directions, and determining the key point according to the gradient direction histogram; Taking the key point as the center, a neighborhood of a preset area is obtained, the neighborhood is evenly divided into a plurality of sub-neighborhoods, and a gradient direction histogram of each sub-neighborhood is calculated to obtain a plurality of sub-gradient direction histograms; According to each of the sub-gradient direction histograms, the image distribution characteristics of the picture data or video data are obtained.

5. The event-driven data conversion method according to claim 1, characterized in that: The step of converting the data to be converted according to the set conversion strategy to obtain a conversion result includes: The data to be converted is converted into a string type, and the string function is used to convert the data to be converted whose key is not a string value to obtain a conversion result; The data to be converted is converted into a numerical type, and the parseInt function is used to extract the numerical value in the data to be converted whose key is a string value to obtain an extraction result, and the extraction result is determined as the conversion result; If the key of the data to be converted is not a string value or a numerical value, the string function is used to convert the data to be converted into a string type to obtain string data, and the parseInt function is used to extract the numerical value in the string data to obtain a conversion result.

6. The event-driven data conversion method according to claim 3, characterized in that: The step of converting the data to be converted according to the set conversion strategy to obtain a conversion result further includes: When the data to be converted whose key is a floating-point key is converted into the integer key, a preset conversion formula is used for conversion, wherein the preset conversion formula is: ; In the formula, b represents the converted data, and a represents the data to be converted whose key value is a floating-point type.

7. The event-driven data conversion method according to claim 1, characterized in that: When the method enables the user to view the conversion result at the consumer end, it also includes: Obtaining a binary code of the conversion result, and calculating a hash value to be checked according to the binary code; It is determined whether the hash value to be checked is the same as the hash value of the conversion result. If they are the same, it is determined that the conversion result is a correct conversion result.

8. An event-driven data conversion system, characterized in that: include: A receiving module, used to receive data uploaded from input interfaces of a plurality of pre-set clients, and obtain data to be converted corresponding to each of the clients; A calculation module, used to calculate each of the data to be converted by using a hash algorithm to obtain a hash value of the data to be converted, and store the hash value and the data to be converted in a blockchain; A partitioning module is used to assign keys and key values ​​to each data to be converted according to a preset partitioning strategy, and based on the key, store the key value of each data to be converted into a corresponding partition to obtain multiple groups of data, wherein each group of conversion data includes multiple key values ​​of the data to be converted; The conversion module is used to send the key value of the data to be converted in each group to the corresponding identification resolution module, so that the identification resolution module uses the identification unit to identify the port address of the data to be converted to obtain a first identification result, and sends the key value of the data to be converted to the corresponding conversion unit according to the first identification result, so that the conversion unit converts the key value of the data to be converted according to the set conversion strategy to obtain a conversion result, and sends the conversion result to the corresponding consumer end, so that the user can view the conversion result at the consumer end.

9. The event-driven data conversion method according to claim 8, characterized in that: The calculation module includes a binary code conversion unit and an extraction unit, The binary code conversion unit is used to perform binary code conversion on the data to be converted to obtain the binary code of the data to be converted; The extraction unit is used to extract information from the binary code to obtain a fixed identifier of the data to be converted, and calculate the fixed identifier using a hash algorithm to obtain a hash value of the data to be converted, wherein the fixed identifier is composed of the 1st to 10th bytes and the Nth to N-10th bytes in the binary code, and N is an integer greater than or equal to 1.

10. The event-driven data conversion method according to claim 8, characterized in that: The partition module includes a first partition unit, a second partition unit and a third partition unit. Wherein, the first partitioning unit is used for, when the data type of the data to be converted is text data, using the string key as the key of the data to be converted, extracting the feature vector of the text data, and using the feature vector as the key value; The second partitioning unit is used for, when the data type of the data to be converted is numerical data, using the numerical key as the key of the data to be converted and the actual numerical value as the key value, wherein the numerical key includes an integer key and a floating point key; The third partitioning unit is used to use the timestamp of the picture or video data as a key when the data type of the data to be converted is picture data or video data, and utilize the improved extraction algorithm to extract the image distribution characteristics of the picture data or video data, and use the image distribution characteristics as the key value of the data to be converted.

Citation Information

Patent Citations

  • Key value database-based data storage method and retrieval method and corresponding devices

    CN114090575A

  • System, method, and computer program product for key-value commitments from accumulators and vector commitments

    WO2024249467A2