CN114938293A - NGINX data tracing method, device, equipment and storage medium based on block chain - Google Patents
NGINX data tracing method, device, equipment and storage medium based on block chain Download PDFInfo
- Publication number
- CN114938293A CN114938293A CN202210461883.0A CN202210461883A CN114938293A CN 114938293 A CN114938293 A CN 114938293A CN 202210461883 A CN202210461883 A CN 202210461883A CN 114938293 A CN114938293 A CN 114938293A
- Authority
- CN
- China
- Prior art keywords
- data
- request
- tracing
- uplink
- response
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 230000004044 response Effects 0.000 claims abstract description 105
- 238000012856 packing Methods 0.000 claims abstract description 42
- 238000004806 packaging method and process Methods 0.000 claims abstract description 20
- 238000004458 analytical method Methods 0.000 claims description 31
- 230000005540 biological transmission Effects 0.000 claims description 29
- 238000013523 data management Methods 0.000 claims description 17
- 230000006870 function Effects 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 claims description 9
- 238000013507 mapping Methods 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 4
- 230000006835 compression Effects 0.000 claims description 4
- 238000007906 compression Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 7
- 238000013473 artificial intelligence Methods 0.000 abstract description 5
- 238000004891 communication Methods 0.000 description 8
- 238000007726 management method Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012163 sequencing technique Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- ZLIBICFPKPWGIZ-UHFFFAOYSA-N pyrimethanil Chemical compound CC1=CC(C)=NC(NC=2C=CC=CC=2)=N1 ZLIBICFPKPWGIZ-UHFFFAOYSA-N 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000012384 transportation and delivery Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
- H04L63/126—Applying verification of the received information the source of the received data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
- H04L9/3239—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Debugging And Monitoring (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to an artificial intelligence technology, and discloses a NGINX data tracing method based on a block chain, which comprises the following steps: initializing a universal component and an uplink tracing component of the NGINX gateway, and acquiring request data; calculating a request abstract of the request data, and transmitting the request abstract into a message queue; forwarding the request data to an application system to obtain response data; forwarding the response data to the NGINX gateway for response, and uploading the response data to a message queue; analyzing the data types of the request abstract and the response data, and determining the data packing size; packaging the request abstract and the response data into uplink data, and transmitting the uplink data into a preset block chain; and performing source tracing query on the uplink data. In addition, the invention also relates to a block chain technology, and the request summary and the response data can be stored in the nodes of the block chain. The invention also provides an NGINX data tracing device, equipment and a storage medium based on the block chain. The invention can improve the efficiency of tracing the gateway data.
Description
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a NGINX data tracing method, device, equipment and storage medium based on a block chain.
Background
With the continuous development of internet technology, the volume of data also increases explosively, in order to obtain useful information through data, the data needs to be processed, and in the process of processing the data, the source and the reliability of the existing data need to be accurately judged through a data tracing technology so as to ensure the authenticity of the data.
The existing data tracing technology is mostly simple data tracing based on a block chain, in practical application, in order to achieve the purposes of data tamper resistance and data tracing, steps such as signature and chaining are generally carried out through a system interface of an application program integrated third party, so that data tracing is carried out, the system interface of the third party is possibly unmatched, the application range is small, and the data chaining and the packaging speed are slow, so that the efficiency when the data tracing is carried out on a gateway is low.
Disclosure of Invention
The invention provides a NGINX data tracing method, device, equipment and storage medium based on a block chain, and mainly aims to solve the problem of low efficiency in tracing data of a gateway.
In order to achieve the above object, the NGINX data tracing method based on a block chain provided by the present invention includes:
initializing a general component and an uplink tracing component of the NGINX gateway, and acquiring request data through the general component;
calculating a request abstract of the request data through the uplink tracing component, and transmitting the request abstract into a preset message queue;
forwarding the request data to an application system to obtain response data of the application system to the request data;
forwarding the response data to the NGINX gateway, responding the request data by utilizing the general component according to the response data, and uploading the response data to the message queue;
performing data type analysis on the request abstract and the response data in the message queue through the uplink tracing component, and determining the data packing size according to the analysis result;
packaging the request abstract and the response data according to the data packaging size to obtain uplink data, and transmitting the uplink data into a preset block chain;
and performing source tracing query on the uplink data in the block chain through a preset data management platform.
Optionally, said calculating a match value between said product representation and each of said user representations comprises:
calling a preset filling method through the uplink tracing component to fill the request data to generate filling data;
calling a preset expansion method through the uplink tracing component to expand the filling data to generate expanded data, and splitting the expanded data into a preset constant number of data groups;
and calling a preset compression function through the uplink tracing component to iteratively compress the data sets into compressed data sets one by one, and splicing the compressed data sets into a request abstract.
Optionally, the transmitting the request digest into a preset message queue includes:
determining transmission cache data of the request summary in a unit transmission batch according to the batch transmission quantity and the maximum cache quantity which are pre-configured in the message queue;
and transmitting the transmission cache data to the message queue batch by batch according to preset asynchronous cache time.
Optionally, the responding, by using the generic component, to the request data according to the response data includes:
analyzing a response address, form data and an event method from the response data through the general component;
and responding to the request data of the response address through the event method and the form data.
Optionally, the analyzing the data type of the request digest and the response data in the message queue through the uplink tracing component, and determining the data packing size according to the analysis result includes:
calling a preset decoder through the uplink tracing component to respectively perform type decoding on the request abstract and the response data to obtain a request type sequence of the request abstract and a response type sequence of the response data, and merging the request type sequence and the response type sequence into a data type sequence;
and processing the data type sequence through a preset packing rule instruction to obtain a packing size mapping sequence.
Optionally, the packaging the request digest and the response data according to the data packaging size to obtain uplink data, and transmitting the uplink data into a preset block chain includes:
serializing the request summary and the response data through a preset serialization tool to obtain a primary uplink sequence;
performing hash signature on the primary uplink sequence through a preset signature tool to obtain a secondary uplink sequence;
packaging the secondary uplink sequence according to the packaging size mapping sequence to obtain uplink data;
and selecting a node from the block chain as a target node, transmitting the uplink data into the target node, and broadcasting the uplink data to other nodes except the target node in the block chain to obtain a consensus block.
Optionally, the performing, by using a preset data management platform, a source tracing query on the uplink data in the block chain includes:
obtaining target traceability data through the data management platform;
inquiring the common identification blocks of the block chain according to the target tracing data to obtain the tracing information of the target tracing data;
and displaying the tracing information on the data management platform to complete tracing inquiry.
In order to solve the above problem, the present invention further provides a block chain-based NGINX data tracing apparatus, where the apparatus includes:
the component initialization module is used for initializing a general component and an uplink tracing component of the NGINX gateway and acquiring request data through the general component;
the abstract calculation module is used for calculating a request abstract of the request data through the uplink tracing component and transmitting the request abstract into a preset message queue;
the request forwarding module is used for forwarding the request data to an application system to obtain response data of the application system to the request data;
a request response module, configured to forward the response data to the NGINX gateway, respond to the request data according to the response data by using the general component, and upload the response data to the message queue;
the type analysis module is used for carrying out data type analysis on the request abstract and the response data in the message queue through the uplink tracing component and determining the data packing size according to an analysis result;
the packed uplink module is used for packing the request abstract and the response data according to the data packing size to obtain uplink data, and transmitting the uplink data into a preset block chain;
and the source tracing query module is used for performing source tracing query on the uplink data in the block chain through a preset data management platform.
In order to solve the above problem, the present invention also provides an apparatus comprising:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the blockchain-based NGINX data tracing method described above.
In order to solve the above problem, the present invention further provides a storage medium, where at least one computer program is stored in the storage medium, and the at least one computer program is executed by a processor in a device to implement the above NGINX data tracing method based on a blockchain.
According to the embodiment of the invention, the NGINX gateway is selected, so that the deployment efficiency of the gateway can be improved, the application range of gateway data tracing is expanded, the safety of data information transmission can be ensured by calculating the request abstract, the request data and the response data can be connected in series by unique numbers, the subsequent data tracing is facilitated, meanwhile, the request abstract is transmitted into the message queue through asynchronous transmission, the loss of data transmission on the performance of the gateway can be effectively reduced, the response time is reduced, and the efficiency of data tracing is improved; the cache database is used as a data transmission medium, so that the transmission pressure of the gateway is reduced, the performance loss of the gateway is reduced, the data type analysis is performed on the request abstract and the response data in the message queue through the uplink tracing component, the data packing size is determined according to the analysis result, different packing sizes can be selected for data of different data types, the data packing time can be effectively reduced, and the data tracing efficiency is improved. Therefore, the NGINX data tracing method, device, equipment and storage medium based on the block chain can solve the problem of low efficiency when the data tracing is carried out on the gateway.
Drawings
Fig. 1 is a schematic flowchart of a source tracing method for NGINX data based on a blockchain according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a process of computing a request digest according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of packed uplink according to an embodiment of the present invention;
fig. 4 is a functional block diagram of an NGINX data tracing apparatus based on a block chain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a device for implementing the method for tracing NGINX data based on a blockchain according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an NGINX data tracing method based on a block chain. The execution subject of the block chain-based NGINX data tracing method includes, but is not limited to, at least one of devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the blockchain-based NGINX data tracing method may be performed by software or hardware installed in a terminal device or a server device, where the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of an NGINX data tracing method based on a block chain according to an embodiment of the present invention. In this embodiment, the NGINX data tracing method based on a blockchain includes:
s1, initializing a universal component and an uplink tracing component of the NGINX gateway, and acquiring request data through the universal component;
in the embodiment of the invention, the NGINX gateway is a high-performance hypertext transfer protocol and reverse proxy server, and is also a gateway which is simple to install, concise in configuration file and less in error.
In detail, the generic component includes a rule component, a rule configuration component, and a base function component.
Specifically, the uplink tracing component may be an integrated module of a gateway and a block chain.
In the embodiment of the invention, the NGINX gateway has better support on the old platform, and the NGINX gateway is selected to improve the deployment efficiency of the gateway and expand the application range of gateway data tracing.
S2, calculating the request abstract of the request data through the uplink tracing component, and transmitting the request abstract into a preset message queue;
in the embodiment of the present invention, the message queue may be Kafka, which is an open source stream processing platform written by Scala and Java, and Kafka is a high throughput distributed publish-subscribe messaging system, which can process all the action stream data of the consumer in the website.
In the embodiment of the present invention, referring to fig. 2, the calculating the request summary of the requested data by the uplink tracing component includes steps S21-S23:
s21, calling a preset filling method through the uplink tracing component to fill the request data to generate filling data;
s22, expanding the filling data to generate expanded data by calling a preset expanding method through the uplink tracing component, and splitting the expanded data into a plurality of preset constant data groups;
and S23, calling a preset compression function through the uplink tracing component to iteratively compress the data groups into compressed data groups one by one, and splicing the compressed data groups into a request abstract.
In detail, the padding method may be a fill () method.
In particular, the extension method may be the msgExten () method.
Specifically, the preset constant may be 16.
In detail, the compression function may be an Iter () function.
Specifically, the transmitting the request digest into a preset message queue includes: determining transmission cache data of the request summaries in unit transmission batches according to the batch transmission quantity and the maximum cache quantity which are pre-configured in the message queue; and transmitting the transmission cache data into the message queue batch by batch according to preset asynchronous cache time.
In the embodiment of the invention, the safety of data information transmission can be ensured by calculating the request abstract, the request data and the response data can be connected in series by unique numbers, the subsequent data tracing is facilitated, meanwhile, the request abstract is transmitted into the message queue by asynchronous transmission, the loss of data transmission on the performance of the gateway can be effectively reduced, the response time is reduced, and the efficiency of data tracing is improved.
S3, forwarding the request data to an application system to obtain response data of the application system to the request data;
in this embodiment of the present invention, the forwarding the request data to the application system includes: and forwarding the request data to a preset cache database, and forwarding the request data to an application system through the cache database.
In detail, the cache database may be a Redis (remote Dictionary server), which is an open source supporting network, a log-type database that may be based on a memory or may be persistent, and a Key-Value database, and provides interfaces of multiple languages.
In the embodiment of the invention, the request data is forwarded to the cache database, and the cache database can be used as a data transmission medium, so that the transmission pressure of the gateway is reduced, the performance loss of the gateway is reduced, and the data tracing efficiency is improved.
S4, forwarding the response data to the NGINX gateway, responding the request data by using the general component according to the response data, and uploading the response data to the message queue;
in the embodiment of the present invention, the method for forwarding the response data to the NGINX gateway is consistent with the method for forwarding the request data to the application system in step S3.
In this embodiment of the present invention, the responding, by using the generic component, to the request data according to the response data includes: analyzing a response address, form data and an event method from the response data through the general component; and responding to the request data of the response address through the event method and the form data.
In this embodiment of the present invention, the method for uploading the response data to the message queue is the same as the method for uploading the request digest to the predetermined message queue in step S2.
S5, performing data type analysis on the request abstract and the response data in the message queue through the uplink tracing component, and determining the data packing size according to the analysis result;
in an embodiment of the present invention, the performing data type analysis on the request digest and the response data in the message queue through the uplink tracing component, and determining a data packing size according to an analysis result includes: calling a preset decoder through the uplink tracing component to respectively perform type decoding on the request abstract and the response data to obtain a request type sequence of the request abstract and a response type sequence of the response data, and merging the request type sequence and the response type sequence into a data type sequence; and processing the data type sequence through a preset packing rule instruction to obtain a packing size mapping sequence.
In detail, the decoder may be a Content-Type decoder, where the Content-Type is a header field in the HTTP protocol and is used to indicate a file Type of the transmission data, such as a format of text, picture, video, etc., for example, the Content-Type is text/html; the character UTF-8 indicates the HTML format file encoded by UTF 8.
Specifically, the packing rule instruction may be an LUA instruction that matches a data type and a packing size with each other; for example, for data of text type, the packing size is 10kb per packet, and for data of image type, the packing size is 100kb per packet; the packaging rule instruction can be input by a user, or the uplink tracing component is obtained through historical packaging data learning.
Specifically, the packed size mapping sequence refers to a sequence of packed sizes mapped one by one with the request digest and the response data.
In the embodiment of the invention, the data type analysis is carried out on the request abstract and the response data in the message queue through the uplink tracing component, and the data packing size is determined according to the analysis result, so that different packing sizes can be selected for data of different data types, the data packing time can be effectively reduced, and the data tracing efficiency is further improved.
S6, packing the request abstract and the response data according to the data packing size to obtain uplink data, and transmitting the uplink data into a preset block chain;
in the embodiment of the present invention, referring to fig. 3, the packaging the request digest and the response data according to the data packaging size to obtain uplink data, and transmitting the uplink data into a preset block chain includes steps S31-S34:
s31, serializing the request summary and the response data through a preset serialization tool to obtain a primary uplink sequence;
s32, carrying out hash signature on the primary uplink sequence through a preset signature tool to obtain a secondary uplink sequence;
s33, packing the secondary uplink sequence according to the packing size mapping sequence to obtain uplink data;
s34, selecting a node from the block chain as a target node, transmitting the uplink data to the target node, and broadcasting to other nodes except the target node in the block chain to obtain a consensus block.
In detail, the sequencing tool may be a Json sequencing tool, including but not limited to Json-lib, fastJson, Jackson, Gson.
In this embodiment of the present invention, the block chain may be an open source alliance chain.
In detail, the common identification block includes a timestamp and a modification record of the uplink data.
In the embodiment of the invention, the request abstract and the response data are serialized, so that the data can be conveniently packaged according to types, meanwhile, the data can be effectively prevented from being tampered, the identity and the information of a sender can be bound by carrying out hash signature on the primary uplink data, a basis is provided for tracing the source of the subsequent data, meanwhile, other people are prevented from pretending to be the sender, the data is prevented from being tampered, and the safety and the uniqueness of the data can be ensured by broadcasting other nodes except the target node.
And S7, performing source tracing inquiry on the uplink data in the block chain through a preset data management platform.
In an embodiment of the present invention, the performing a source tracing query on the uplink data in the block chain through a preset data management platform includes: obtaining target traceability data through the data management platform; inquiring the common identification blocks of the block chain according to the target tracing data to obtain the tracing information of the target tracing data; and displaying the tracing information on the data management platform to complete tracing inquiry.
In the embodiment of the present invention, the target tracing data may be a unique number or a hash digest of the corresponding uplink data.
In detail, the traceability information includes a modification record, sender information, a time stamp, and the like.
In the embodiment of the invention, the data management platform can facilitate the user to trace the source of the data, fully display the tracing information and further improve the interactive experience of the user.
According to the embodiment of the invention, the NGINX gateway is selected, so that the deployment efficiency of the gateway can be improved, the application range of gateway data tracing is expanded, the safety of data information transmission can be ensured by calculating the request abstract, the request data and the response data can be connected in series by unique numbers, the subsequent data tracing is facilitated, meanwhile, the request abstract is transmitted into the message queue through asynchronous transmission, the loss of data transmission on the performance of the gateway can be effectively reduced, the response time is reduced, and the efficiency of data tracing is improved; the cache database is used as a data transmission medium, so that the transmission pressure of the gateway is reduced, the performance loss of the gateway is reduced, the data type analysis is performed on the request abstract and the response data in the message queue through the uplink tracing component, the data packing size is determined according to the analysis result, different packing sizes can be selected for data of different data types, the data packing time can be effectively reduced, and the data tracing efficiency is improved. Therefore, the NGINX data tracing method based on the block chain can solve the problem of low efficiency when the data tracing is carried out on the gateway.
Fig. 4 is a functional block diagram of an NGINX data tracing apparatus based on a block chain according to an embodiment of the present invention.
The block chain-based NGINX data tracing apparatus 100 of the present invention can be installed in a device. According to the implemented functions, the block chain-based NGINX data tracing apparatus 100 may include a component initialization module 101, a summary calculation module 102, a request forwarding module 103, a request response module 104, a type analysis module 105, a packed uplink module 106, and a tracing query module 107. The modules of the invention, which may also be referred to as units, are a series of computer program segments capable of being executed by a processor of a device and performing fixed functions, and are stored in a memory of the device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the component initialization module 101 is configured to initialize a general component and an uplink tracing component of the NGINX gateway, and acquire request data through the general component;
the digest calculation module 102 is configured to calculate a request digest of the requested data through the uplink tracing component, and transmit the request digest into a preset message queue;
the request forwarding module 103 is configured to forward the request data to an application system, so as to obtain response data of the application system to the request data;
the request response module 104 is configured to forward the response data to the NGINX gateway, respond to the request data according to the response data by using the general component, and upload the response data to the message queue;
the type analysis module 105 is configured to perform data type analysis on the request digest and the response data in the message queue through the uplink tracing component, and determine a data packing size according to an analysis result;
the packed uplink module 106 is configured to pack the request digest and the response data according to the data packing size to obtain uplink data, and transmit the uplink data to a preset block chain;
the source tracing query module 107 is configured to perform source tracing query on the uplink data in the block chain through a preset data processing platform.
In detail, when the modules in the block chain based NGINX data tracing apparatus 100 according to the embodiment of the present invention are used, the same technical means as the block chain based NGINX data tracing method described in fig. 1 to fig. 3 are adopted, and the same technical effect can be produced, which is not described herein again.
Fig. 5 is a schematic structural diagram of a device for implementing an NGINX data tracing method based on a blockchain according to an embodiment of the present invention.
The device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program, such as a zoned-based NGINX data tracing program, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the device, connects various components of the whole device by using various interfaces and lines, and executes various functions of the device and processes data by running or executing programs or modules stored in the memory 11 (for example, executing a zonein data tracing program based on a blockchain, etc.), and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the device, for example a removable hard disk of the device. The memory 11 may also be an external storage device of the device in other embodiments, such as a plug-in removable hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the device. Further, the memory 11 may also include both an internal storage unit of the device and an external storage device. The memory 11 can be used for storing not only application software installed in the device and various types of data, such as code of a zoned-based NGINX data tracing program, but also temporarily storing data that has been output or will be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the above-mentioned device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the device and other devices. The user interface may be a Display (Display), an input unit, such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the device and for displaying a visualized user interface.
Only devices having components are shown, it will be understood by those skilled in the art that the structures shown in the figures do not constitute limitations on the devices, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
For example, although not shown, the apparatus may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions such as charge management, discharge management, and power consumption management are implemented through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The device may further include various sensors, a bluetooth module, a Wi-Fi module, etc., which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The block chain-based NGINX data tracing program stored in the memory 11 of the device 1 is a combination of a plurality of instructions, and when running in the processor 10, can realize:
initializing a general component and an uplink tracing component of the NGINX gateway, and acquiring request data through the general component;
calculating a request abstract of the request data through the uplink tracing component, and transmitting the request abstract into a preset message queue;
forwarding the request data to an application system to obtain response data of the application system to the request data;
forwarding the response data to the NGINX gateway, responding the request data by utilizing the general component according to the response data, and uploading the response data to the message queue;
performing data type analysis on the request abstract and the response data in the message queue through the uplink tracing component, and determining the data packing size according to the analysis result;
packaging the request abstract and the response data according to the data packaging size to obtain uplink data, and transmitting the uplink data into a preset block chain;
and performing source tracing query on the uplink data in the block chain through a preset data management platform.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the device 1 may be stored in a storage medium if implemented in the form of software functional units and sold or used as separate products. The storage medium may be volatile or nonvolatile. For example, the storage medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic diskette, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The invention also provides a storage medium storing a computer program which, when executed by a processor of a device, enables:
initializing a general component and an uplink tracing component of the NGINX gateway, and acquiring request data through the general component;
calculating a request abstract of the request data through the uplink tracing component, and transmitting the request abstract into a preset message queue;
forwarding the request data to an application system to obtain response data of the application system to the request data;
forwarding the response data to the NGINX gateway, responding the request data by utilizing the general component according to the response data, and uploading the response data to the message queue;
performing data type analysis on the request abstract and the response data in the message queue through the uplink tracing component, and determining the data packing size according to the analysis result;
packaging the request abstract and the response data according to the data packaging size to obtain uplink data, and transmitting the uplink data into a preset block chain;
and performing source tracing query on the uplink data in the block chain through a preset data management platform.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (10)
1. A NGINX data tracing method based on a block chain is characterized by comprising the following steps:
initializing a general component and an uplink tracing component of the NGINX gateway, and acquiring request data through the general component;
calculating a request abstract of the request data through the uplink tracing component, and transmitting the request abstract into a preset message queue;
forwarding the request data to an application system to obtain response data of the application system to the request data;
forwarding the response data to the NGINX gateway, responding the request data by utilizing the general component according to the response data, and uploading the response data to the message queue;
performing data type analysis on the request abstract and the response data in the message queue through the uplink tracing component, and determining the data packing size according to the analysis result;
packaging the request abstract and the response data according to the data packaging size to obtain uplink data, and transmitting the uplink data into a preset block chain;
and performing source tracing query on the uplink data in the block chain through a preset data management platform.
2. The blockchain-based NGINX data tracing method of claim 1 wherein said calculating, by the uplink tracing component, a request digest of the requested data comprises:
calling a preset filling method through the uplink tracing component to fill the request data to generate filling data;
calling a preset expansion method through the uplink tracing component to expand the filling data to generate expanded data, and splitting the expanded data into a preset constant number of data groups;
and calling a preset compression function through the uplink tracing component to iteratively compress the data groups into compressed data groups one by one, and splicing the compressed data groups into a request abstract.
3. The blockchain-based NGINX data tracing method according to claim 1, wherein the passing the request digest into a preset message queue comprises:
determining transmission cache data of the request summaries in unit transmission batches according to the batch transmission quantity and the maximum cache quantity which are pre-configured in the message queue;
and transmitting the transmission cache data to the message queue batch by batch according to preset asynchronous cache time.
4. The blockchain-based NGINX data tracing method of claim 1, wherein said responding to the request data according to the response data using the generic component comprises:
analyzing a response address, form data and an event method from the response data through the general component;
and responding to the request data of the response address through the event method and the form data.
5. The blockchain-based NGINX data tracing method of claim 1 wherein said performing data type analysis on the request digest and the response data in the message queue through the uplink tracing component and determining a data packing size according to the analysis result comprises:
calling a preset decoder through the uplink tracing component to respectively perform type decoding on the request abstract and the response data to obtain a request type sequence of the request abstract and a response type sequence of the response data, and merging the request type sequence and the response type sequence into a data type sequence;
and processing the data type sequence through a preset packing rule instruction to obtain a packing size mapping sequence.
6. The method of claim 1, wherein the step of packing the request digest and the response data according to the data packing size to obtain uplink data, and transmitting the uplink data into a predetermined blockchain comprises:
serializing the request summary and the response data through a preset serialization tool to obtain a primary uplink sequence;
performing hash signature on the primary uplink sequence through a preset signature tool to obtain a secondary uplink sequence;
packaging the secondary uplink sequence according to the packaging size mapping sequence to obtain uplink data;
and selecting a node from the block chain as a target node, transmitting the uplink data into the target node, and broadcasting the uplink data to other nodes except the target node in the block chain to obtain a consensus block.
7. The method as claimed in any one of claims 1 to 6, wherein the performing a source tracing query on the uplink data in the blockchain through a predetermined data management platform includes:
obtaining target traceability data through the data management platform;
inquiring the common identification blocks of the block chain according to the target tracing data to obtain the tracing information of the target tracing data;
and displaying the tracing information on the data management platform to complete tracing inquiry.
8. An NGINX data tracing apparatus based on a block chain, the apparatus comprising:
the component initialization module is used for initializing a general component and an uplink tracing component of the NGINX gateway and acquiring request data through the general component;
the abstract calculation module is used for calculating a request abstract of the request data through the uplink tracing component and transmitting the request abstract into a preset message queue;
the request forwarding module is used for forwarding the request data to an application system to obtain response data of the application system to the request data;
the request response module is used for forwarding the response data to the NGINX gateway, responding the request data by utilizing the general component according to the response data and uploading the response data to the message queue;
the type analysis module is used for carrying out data type analysis on the request abstract and the response data in the message queue through the uplink tracing component and determining the data packing size according to the analysis result;
the packed uplink module is used for packing the request abstract and the response data according to the data packing size to obtain uplink data, and transmitting the uplink data into a preset block chain;
and the source tracing query module is used for performing source tracing query on the uplink data in the block chain through a preset data management platform.
9. An apparatus, characterized in that the apparatus comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the blockchain-based NGINX data tracing method according to any one of claims 1 to 7.
10. A storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the blockchain-based NGINX data tracing method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210461883.0A CN114938293B (en) | 2022-04-28 | 2022-04-28 | NGINX data tracing method, device, equipment and storage medium based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210461883.0A CN114938293B (en) | 2022-04-28 | 2022-04-28 | NGINX data tracing method, device, equipment and storage medium based on block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114938293A true CN114938293A (en) | 2022-08-23 |
CN114938293B CN114938293B (en) | 2024-03-12 |
Family
ID=82862649
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210461883.0A Active CN114938293B (en) | 2022-04-28 | 2022-04-28 | NGINX data tracing method, device, equipment and storage medium based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114938293B (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019100991A1 (en) * | 2017-11-27 | 2019-05-31 | 北京京东金融科技控股有限公司 | Information processing method, device and system, storage medium, and electronic device |
CN110011793A (en) * | 2019-04-03 | 2019-07-12 | 上海中商网络股份有限公司 | Anti-fake data processing method of tracing to the source, device, equipment and medium |
CN111475530A (en) * | 2020-04-08 | 2020-07-31 | 珠海复旦创新研究院 | Traceability information verification query method, device and equipment based on block chain |
CN111523888A (en) * | 2020-04-16 | 2020-08-11 | 武汉有牛科技有限公司 | On-chain data and information traceability system based on block chain technology |
CN111552676A (en) * | 2020-04-26 | 2020-08-18 | 北京众享比特科技有限公司 | Block chain based evidence storing method, device, equipment and medium |
CN111681015A (en) * | 2020-06-10 | 2020-09-18 | 复旦大学 | Product tracing method, system and equipment based on alliance chain |
CN112200690A (en) * | 2020-10-27 | 2021-01-08 | 西安纸贵互联网科技有限公司 | Ship quality traceability system based on block chain |
CN112734448A (en) * | 2021-01-12 | 2021-04-30 | 成都库珀区块链科技有限公司 | Agricultural product tracing method, system, equipment and storage medium based on block chain |
US20210157788A1 (en) * | 2019-10-15 | 2021-05-27 | Tencent Technology (Shenzhen) Company Limited | Data processing method and apparatus based on blockchain network, electronic device, and storage medium |
CN113127307A (en) * | 2021-04-25 | 2021-07-16 | 北京大米科技有限公司 | Method for processing tracing request, related device, system and storage medium |
US20210326912A1 (en) * | 2020-08-21 | 2021-10-21 | Alipay (Hangzhou) Information Technology Co., Ltd. | Blockchain-based data processing systems, methods, and apparatuses |
CN113726525A (en) * | 2021-09-09 | 2021-11-30 | 国网电子商务有限公司 | Energy industry cloud network data tracing method and device |
WO2022061599A1 (en) * | 2020-09-23 | 2022-03-31 | 中国科学院深圳先进技术研究院 | Blockchain-based distributed internet of things instruction management method and system |
-
2022
- 2022-04-28 CN CN202210461883.0A patent/CN114938293B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019100991A1 (en) * | 2017-11-27 | 2019-05-31 | 北京京东金融科技控股有限公司 | Information processing method, device and system, storage medium, and electronic device |
CN110011793A (en) * | 2019-04-03 | 2019-07-12 | 上海中商网络股份有限公司 | Anti-fake data processing method of tracing to the source, device, equipment and medium |
US20210157788A1 (en) * | 2019-10-15 | 2021-05-27 | Tencent Technology (Shenzhen) Company Limited | Data processing method and apparatus based on blockchain network, electronic device, and storage medium |
CN111475530A (en) * | 2020-04-08 | 2020-07-31 | 珠海复旦创新研究院 | Traceability information verification query method, device and equipment based on block chain |
CN111523888A (en) * | 2020-04-16 | 2020-08-11 | 武汉有牛科技有限公司 | On-chain data and information traceability system based on block chain technology |
CN111552676A (en) * | 2020-04-26 | 2020-08-18 | 北京众享比特科技有限公司 | Block chain based evidence storing method, device, equipment and medium |
CN111681015A (en) * | 2020-06-10 | 2020-09-18 | 复旦大学 | Product tracing method, system and equipment based on alliance chain |
US20210326912A1 (en) * | 2020-08-21 | 2021-10-21 | Alipay (Hangzhou) Information Technology Co., Ltd. | Blockchain-based data processing systems, methods, and apparatuses |
WO2022061599A1 (en) * | 2020-09-23 | 2022-03-31 | 中国科学院深圳先进技术研究院 | Blockchain-based distributed internet of things instruction management method and system |
CN112200690A (en) * | 2020-10-27 | 2021-01-08 | 西安纸贵互联网科技有限公司 | Ship quality traceability system based on block chain |
CN112734448A (en) * | 2021-01-12 | 2021-04-30 | 成都库珀区块链科技有限公司 | Agricultural product tracing method, system, equipment and storage medium based on block chain |
CN113127307A (en) * | 2021-04-25 | 2021-07-16 | 北京大米科技有限公司 | Method for processing tracing request, related device, system and storage medium |
CN113726525A (en) * | 2021-09-09 | 2021-11-30 | 国网电子商务有限公司 | Energy industry cloud network data tracing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN114938293B (en) | 2024-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112653760B (en) | Cross-server file transmission method and device, electronic equipment and storage medium | |
CN114844792B (en) | Dynamic monitoring method, device, equipment and storage medium based on LUA language | |
CN113448817A (en) | Page screen recording method and device and storage medium | |
CN112506486A (en) | Search system establishing method and device, electronic equipment and readable storage medium | |
CN112702228B (en) | Service flow limit response method, device, electronic equipment and readable storage medium | |
CN114389889A (en) | File full life cycle management method and device based on block chain technology | |
CN113890712A (en) | Data transmission method and device, electronic equipment and readable storage medium | |
CN114827161A (en) | Service calling request sending method and device, electronic equipment and readable storage medium | |
CN113051224A (en) | File transmission method and device, electronic equipment and computer readable storage medium | |
CN115002011B (en) | Flow bidirectional test method and device, electronic equipment and storage medium | |
CN114938293A (en) | NGINX data tracing method, device, equipment and storage medium based on block chain | |
CN114124878B (en) | Market data issuing method, device, system, equipment and medium | |
CN115941352A (en) | Information security interaction method and device based on big data, electronic equipment and storage | |
CN115033605A (en) | Data query method and device, electronic equipment and storage medium | |
CN115016754A (en) | Method and device for synchronously displaying pages among devices, electronic device and medium | |
CN114942855A (en) | Interface calling method and device, electronic equipment and storage medium | |
CN115174555A (en) | File transmission method and device, electronic equipment and storage medium | |
CN115174541A (en) | H5 resource loading method and device, electronic equipment and storage medium | |
CN114448930A (en) | Short address generation method and device, electronic equipment and computer readable storage medium | |
CN113918517A (en) | Multi-type file centralized management method, device, equipment and storage medium | |
CN114064033A (en) | Front-end component development method and device, electronic equipment and readable storage medium | |
CN113364848A (en) | File caching method and device, electronic equipment and storage medium | |
CN113886244A (en) | Sql statement testing method and device, electronic equipment and readable storage medium | |
CN113452785B (en) | Service access method and device based on offline resources, electronic equipment and medium | |
CN115002100B (en) | File transmission method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |