WO2019072103A1 - 目标数据的获取方法和装置 - Google Patents

目标数据的获取方法和装置 Download PDF

Info

Publication number
WO2019072103A1
WO2019072103A1 PCT/CN2018/108306 CN2018108306W WO2019072103A1 WO 2019072103 A1 WO2019072103 A1 WO 2019072103A1 CN 2018108306 W CN2018108306 W CN 2018108306W WO 2019072103 A1 WO2019072103 A1 WO 2019072103A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
target data
network card
local cache
stored
Prior art date
Application number
PCT/CN2018/108306
Other languages
English (en)
French (fr)
Inventor
梁晨
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2019072103A1 publication Critical patent/WO2019072103A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation

Definitions

  • the present invention relates to the field of data processing, and in particular to a method and apparatus for acquiring target data.
  • a database is a repository that organizes, stores, and manages data according to its data structure.
  • the main data in an IT system exists in the database.
  • the buyer information, seller information, product information, and billing information of the shopping website are stored in the database of the website server.
  • the query operation of the database in the system is very frequent. For example, when clicking on the information of an item on the shopping website, the background server needs to query the item information located in the database and then present it to the front end device.
  • FIG. 1 is a schematic diagram of query data according to the prior art, the query process is:
  • S11 The requesting end sends a query request, and the server network card where the database is located receives the network packet.
  • the network card delivers the network packet to the CPU (Central Processing Unit).
  • CPU Central Processing Unit
  • the CPU parses the protocol type and content in the network packet, and determines whether it is a database query request.
  • the CPU encapsulates the data into a network packet.
  • the network card sends a network packet.
  • the CPU needs to perform the following tasks: (1) Analysis of network messages. The CPU is required to determine whether the NET request is carried in the network packet. If yes, the sql request needs to query which data. (2) Reading data. Even if the data is cached, the CPU reads the data. (3) Encapsulate the result in a network message. After the result is queried, the CPU encapsulates the result in the network packet according to the protocol format and sends the result to the network card. Therefore, the process of data query is almost entirely dependent on the CPU to complete.
  • the embodiment of the invention provides a method and a device for acquiring target data, so as to at least solve the technical problem that the operation of acquiring data in the prior art is all dependent on the CPU, resulting in excessive CPU load.
  • an apparatus for acquiring target data includes: a network card, wherein the network card is configured with one or more processing chips; and the network card is configured to receive a first request from a sending end. a message, wherein the first request message is used to acquire target data, the target data is stored in a preset storage area, and the preset storage area is accessed by a processor; and the network card is configured to store, according to whether the network card is stored in the local cache.
  • a determination result of the backup data of the target data determines a feedback manner of the target data.
  • a method for acquiring target data including: receiving a first request message from a sending end, where the first request message is used to acquire target data, and the target data is stored.
  • the preset storage area is accessed by the processor in the preset storage area; and the feedback manner of the target data is determined according to the determination result of whether the backup data of the target data is stored in the local cache of the network card.
  • the network card in the process of acquiring target data, the network card is used to forward the request message, send the request message to the CPU, and the CPU parses the request message to determine whether the request message is used to request data, and determines the request.
  • the message is used to request the data to initiate the request to the database.
  • the content is executed by the network card, thereby reducing the operating load of the CPU.
  • the network card in the foregoing embodiment of the present application has Processing the chip, the processing chip buffers the data of the partial database, can determine whether the cache in the network card includes the backup data of the target data requested by the sending end, and determines the feedback manner of the target data according to the judgment result, thereby improving the feedback to the requesting end The speed of the data.
  • FIG. 1 is a schematic diagram of a query data according to the prior art
  • FIG. 2 is a schematic diagram of an apparatus for acquiring target data according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of an FPGA intelligent network card according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an optional system for acquiring data according to an embodiment of the present application.
  • FIG. 5 is a block diagram showing the hardware configuration of a computer terminal (or mobile device) for realizing an acquisition method of target data
  • FIG. 6 is a flowchart of a method for acquiring target data according to an embodiment of the present application.
  • FIG. 7 is a flowchart of a method for processing a network data packet sent by a network card receiving and transmitting end according to an embodiment of the present application
  • FIG. 8 is a flowchart of a method for processing a data packet sent by a network card receiving processor according to an embodiment of the present application
  • FIG. 9 is a schematic diagram of a system in accordance with an embodiment of the present application.
  • FIG. 10 is a structural block diagram of a computer terminal according to an embodiment of the present invention.
  • FPGA Field-Programmable Gate Array, field programmable gate array, digital logic circuit integrated chip that has been implemented in parallel and implemented in hardware description language.
  • the server when acquiring data in the database, the server needs to request data from the database according to the information in the request, and the data obtained by the request is packaged, and then returned to the request sending end through the network card, that is, the obtained data.
  • the process relies mainly on the processor to implement, resulting in excessive processor pressure, running load, when the data request is too much, it will reduce the speed of the processor.
  • the present application provides an apparatus for acquiring target data.
  • the apparatus includes: a network card 20, and one or more network cards are configured.
  • a network card configured to receive a first request message from the sending end, where the first request message is used to obtain target data, where the target data is stored in a preset storage area and accessed by the processor to the preset storage area;
  • the network card is configured to determine a feedback manner of the target data according to the judgment result of whether the backup data of the target data is stored in the local cache of the network card.
  • the processing chip may be an FPGA chip
  • the sending end may be a terminal that requests target data.
  • the user clicks on the product details on the shopping website that is, the user sends a first request message to the network card of the shopping website through the terminal, and the target data requested by the first request message is clicked by the user.
  • the detailed information of the product for example, the amount, size, material, comment information, etc. of the product, and the database for storing data in the shopping website may be a preset storage area.
  • the local cache may be a cache area formed by one or more processing chips configured on the network card on the network card.
  • the feedback method of the target data may be directly returned by the network card to the sending end, or may be returned to the sending end after the network card continues to request the database.
  • the network card if the backup data of the target data is stored in the local cache, the network card takes out the backup data in the cache and directly returns the data to the receiving end; if the backup data is not stored in the local cache, the network card will The first request message continues to be sent to the database, requesting target data from the database.
  • FIG. 3 is a schematic diagram of an FPGA intelligent network card according to an embodiment of the present application.
  • an FPGA chip is integrated in the network card, and a data channel for transmitting data exists in the FPGA chip and the network card chip, and the FPGA chip can pass the Ethernet.
  • the network interface communicates with the sender, and the network card chip can communicate with the processor through a PCI-E interface (PCI Express interface). Since the processing chip is added to the data path of the network card, it is possible to determine how to process the data packet by programming the processing chip. In the embodiment of the present application, whether the processing chip stores the target according to the local cache of the network card. Data to determine how the target data is fed back.
  • the network card in the process of acquiring target data, the network card is used to forward the request message, send the request message to the CPU, and the CPU parses the request message to determine whether the request message is used. Requesting the data, and initiating the request to the database in the case of determining that the request message is used to request the data, and the solution provided by the present application performs the foregoing content in the network card, thereby reducing the operational burden of the CPU.
  • the network card also has a processing chip, and the processing chip buffers data of a part of the database, and can determine whether the cache in the network card includes backup data of the target data requested by the transmitting end, and determines a feedback manner of the target data according to the judgment result, thereby improving The speed at which data is fed back to the requester.
  • the network card is further configured to determine that the backup data is stored in the local cache of the network card, and return the backup data to the sending end.
  • the processing chip parses the data packet to determine whether the data packet is a database request, that is, the first message request, and if the data packet is a database request, And determining, in the local cache of the network card, whether the backup data corresponding to the target data requested by the first message request is included, and in the case that the local cache of the network card includes the backup data of the target data requested by the first message request, the target data in the local cache is included.
  • the backup data is returned to the sender to complete the response to the first message request.
  • the intelligent network card directly encapsulates the backup data, and returns the network packet, which does not need to be handed over to the processing. It simplifies data processing, reduces latency, and improves database performance.
  • the network card is further configured to determine that the backup data is not stored in the local cache of the network card, and obtain the first response corresponding to the first request message by forwarding the first request message to the processor. a message, wherein the processor is coupled to the network card, and the first response message carries the target data acquired from the preset storage area;
  • the network card is also used to return the target data to the sender.
  • the above processor may be a CPU.
  • 4 is a schematic diagram of an optional system for acquiring data according to an embodiment of the present application.
  • the network card is an FPGA intelligent network card.
  • the processing chip parses the data packet to determine whether the data packet is a database request, that is, the first message request. If the data packet is a database request, it is determined whether the local cache includes the target data requested by the first message request.
  • the network card sends the first request message to the processor, and the processor requests the target data from the database, and encapsulates the target data and passes the first The response message is returned to the sender.
  • the processor since the local cache of the network card includes the backup data of the target data in the first request message, the processor does not need to perform any operation in the process, in the second target data.
  • the first message request needs to be forwarded to the processor, and the processor requests the target data from the database, so only in the process The processor is required to perform the corresponding operation. It can be seen that the processor does not need to respond to all requests for acquiring target data, thereby achieving the purpose of reducing the burden on the processor.
  • the network card is further configured to determine that a remaining storage space in the local cache of the network card is larger than a storage space required for the target data, and back up the target data to the local cache.
  • the processing chip in the network card parses the network packet to determine whether it is a response to a first request message, if The network packet includes the target data requested by the first request message. At this time, the processing chip determines whether the network card reserves the backup data of the target data for the remaining storage space of the local cache. If permitted, the target data is used. Back up to the local cache. If not allowed, the network packet sent by the processor is directly sent to the Ethernet interface of the network card.
  • the network card is further configured to: when the backup data in the local cache exceeds a first preset threshold, the backup data is not accessed, and the backup data is cleared.
  • the processing chip starts counting every time a target data is received, and if the backup data is not accessed again when the timing exceeds a preset threshold, it is cleared out of the local cache of the network card. .
  • the above solution backs up the target data. If the network card is not accessed after the time exceeding the first preset threshold, it is confirmed that the target data is accessed less frequently, and the backup data can be cleared. This processing is performed for each target data, so that the backup data of the target data with higher frequency of access is saved in the local cache of the network card, thereby further reducing access to the processor, reducing the processor. pressure.
  • the network card is further configured to count the access frequency of the target data, and back up the target data to the local cache when the access frequency is greater than the second preset threshold.
  • the foregoing solution determines whether to store the target data to the local cache according to the access frequency of the target data. Because the storage area of the local cache of the network card is limited, the frequency of the target data being accessed may be counted, and the frequency of the target data being accessed exceeds the second preset. When the value is, back it up to the local cache of the NIC.
  • the network card is further configured to receive a second request message from the sending end, where the second request message is used to request to write data to the preset storage area; and if it is determined that the network card is stored in the local cache If there is a data backup corresponding to the data to be written, the data backup is cleared and the second request message is forwarded to the processor.
  • an embodiment of a method for acquiring target data is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 5 shows a hardware block diagram of a computer terminal (or mobile device) for realizing a method of acquiring target data.
  • computer terminal 50 may include one or more (illustrated by employing 502a, 502b, ..., 502n) processor 502 (processor 502 may include, but is not limited to, micro A processing device such as a processor MCU or a programmable logic device FPGA, a memory 504 for storing data, and a transmission module 506 for communication functions.
  • processor 502 may include, but is not limited to, micro A processing device such as a processor MCU or a programmable logic device FPGA, a memory 504 for storing data, and a transmission module 506 for communication functions.
  • FIG. 5 can also include: display, input/output interface (I/O interface), universal serial bus (USB) port (which can be included as one of the ports of the I/O interface), network interface, power supply And / or camera.
  • I/O interface input/output interface
  • USB universal serial bus
  • FIG. 5 is merely illustrative, and does not limit the structure of the above electronic device.
  • computer terminal 50 may also include more or fewer components than shown in FIG. 5, or have a different configuration than that shown in FIG.
  • processors 502 and/or other data processing circuits may be referred to herein generally as "data processing circuits.”
  • the data processing circuit may be embodied in whole or in part as software, hardware, firmware or any other combination.
  • the data processing circuitry can be a single, separate processing module, or incorporated in whole or in part into any of the other components in computer terminal 50 (or mobile device).
  • the data processing circuit is controlled as a processor (e.g., selection of a variable resistance terminal path connected to the interface).
  • the memory 504 can be used to store software programs and modules of the application software, such as program instructions/data storage devices corresponding to the method for acquiring target data in the embodiment of the present invention, and the processor 502 runs the software programs and modules stored in the memory 504. Thereby, various functional applications and data processing are performed, that is, the above-described method of acquiring target data is implemented.
  • Memory 504 can include high speed random access memory and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 504 can further include memory remotely located relative to processor 502, which can be connected to computer terminal 50 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 506 is for receiving or transmitting data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 50.
  • transmission device 506 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • NIC Network Interface Controller
  • the transmission device 506 can be a Radio Frequency (RF) module for communicating wirelessly with the Internet.
  • RF Radio Frequency
  • the display can be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of computer terminal 50 (or mobile device).
  • LCD liquid crystal display
  • the computer device (or mobile device) shown in FIG. 5 may include hardware components (including circuits), software components (including computers stored on a computer readable medium). Code), or a combination of both hardware and software components. It should be noted that FIG. 5 is only one example of a specific embodiment, and is intended to show the types of components that may be present in the above-described computer device (or mobile device).
  • FIG. 6 is a flowchart of a method for acquiring target data according to an embodiment of the present application.
  • Step S61 Receive a first request message from the sending end, where the first request message is used to acquire target data, where the target data is stored in a preset storage area and accessed by the processor to the preset storage area.
  • the first request message from the sending end may be received by the network card.
  • Step S63 Determine a feedback manner of the target data according to a determination result of whether the backup data of the target data is stored in the local cache of the network card.
  • the local cache may be a cache area formed by one or more processing chips configured on the network card on the network card.
  • the feedback method of the target data may be directly returned by the network card to the sending end, or may be returned to the sending end after the network card continues to request the database.
  • the network card if the backup data of the target data is stored in the local cache, the network card takes out the backup data in the cache and directly returns the data to the receiving end; if the backup data of the target data is not stored in the local cache, Then the network card continues to send the first request message to the database, requesting the target data from the database.
  • determining the feedback manner of the backup data according to the determination result of whether the target data is stored in the local cache of the network card includes: determining that the backup data is stored in the local cache of the network card; and returning the backup data to the sending end.
  • determining the feedback manner of the target data according to the determination result of whether the target data is stored in the local cache of the network card further includes: determining that the backup data is not stored in the local cache of the network card; and performing the first request message by using the first request message Forwarding, the first response message corresponding to the first request message is obtained by the processor, where the first response message carries the target data acquired from the preset storage area; and the target data is returned to the sending end.
  • the storage time of the backup data in the local cache is recorded; when the storage duration exceeds the first preset threshold, it is determined that the backup data has not been accessed; Back up your data.
  • the frequency of accessing the target data is counted; when the access frequency is greater than the first preset threshold, Back up the target data to the local cache.
  • the method further includes: receiving a second request message from the sending end, where the second request is The message is used to request to write data to the preset storage area; determine that the network card local cache stores a data backup corresponding to the data to be written; clear the data backup, and forward the second request message to the processor.
  • the above method is applicable to a network card.
  • FIG. 7 is a flowchart of a method for processing a network data packet sent by a network card receiving and transmitting end according to an embodiment of the present application. The method for acquiring target data in the application embodiment is described below with reference to FIG. 7 .
  • step S72 whether it is a data packet for reading data.
  • the flow proceeds to step S73, and otherwise proceeds to step S75.
  • step S73 Whether the local cache contains backup data of the target data. In the case where the backup data of the target data is included in the local cache, the flow proceeds to step S74, and otherwise proceeds to step S78.
  • the backup data of the target data may be stored in the local cache of the network card, the backup data may be encapsulated by the processing chip in the network card and returned to the transmitting end.
  • step S75 whether it is a data packet for writing data, if the network data packet is a data packet for writing data, the process proceeds to step S76, otherwise, the process proceeds to step S78.
  • the NIC local cache stores backup data of the data to be written. If the backup data of the data to be written is stored in the local cache, the process proceeds to step S77, and otherwise proceeds to step S78.
  • the backup data corresponding to the data to be written is stored in the local cache of the network card, it can be confirmed that the backup data corresponding to the data to be written stored in the current local cache is invalid data, so it is cleared from the local cache.
  • the network card sends the network data packet to the processor, and the processor requests the target data from the database, and the processor returns the data returned by the database, and then Return to the sender through the network card.
  • the network card transmits the network data to the processor, and the corresponding processing is performed by the processor.
  • the backup data corresponding to the data to be written is not stored in the local cache of the network card
  • the data to be written is sent to the server, and the server backs up the data to be written to the database.
  • FIG. 8 is a flowchart of a method for processing a data packet sent by a network card receiving processor according to an embodiment of the present application. The method for acquiring target data in the application embodiment is described below with reference to FIG. 8 .
  • S81 Receive a data packet sent by the processor.
  • the above processor may be a CPU.
  • step S82 whether it is the return data of the read database operation. If the data packet is the return data of the read database operation, the process proceeds to step S83, otherwise to step S85.
  • step S83 there is enough storage space in the local cache. If there is still enough storage space in the local cache, then go to step S84, otherwise go to step S85.
  • the data packet is directly sent to the network port.
  • the data packet is directly sent to the network port.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • a system is further provided. As shown in FIG. 9, the system includes:
  • a memory 92 coupled to the processor, is operative to provide the processor with instructions to perform the following processes:
  • the feedback manner of the target data is determined according to the judgment result of whether the backup data of the target data is stored in the local cache of the network card.
  • the foregoing processor may further perform other steps as in Embodiment 1, and details are not described herein again.
  • Embodiments of the present invention may provide a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
  • the computer terminal may execute the program code of the following steps in the method for acquiring the target data: receiving the first request message from the sending end, where the first request message is used to acquire target data, and the target data is stored in the pre-
  • the storage area is set and the preset storage area is accessed by the processor; and the feedback manner of the target data is determined according to whether the backup data of the target data is stored in the local cache of the network card.
  • FIG. 10 is a structural block diagram of a computer terminal according to an embodiment of the present invention.
  • the computer terminal A can include one or more (only one shown) processor 1002, memory 1004, and peripheral interface 1006.
  • the memory can be used to store software programs and modules, such as the method for acquiring target data and the program instructions/modules corresponding to the device in the embodiment of the present invention, and the processor executes various programs by running software programs and modules stored in the memory. Functional application and data processing, that is, the method of acquiring the above target data.
  • the memory may include a high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • the memory can further include memory remotely located relative to the processor, which can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the processor may call the memory stored information and the application by the transmitting device to perform the steps of: receiving the first request message from the sending end, wherein the first request message is used to acquire the target data, and the target data is stored in the preset storage.
  • the area accesses the preset storage area through the processor; and determines the feedback manner of the target data according to the judgment result of whether the backup data of the target data is stored in the local cache of the network card.
  • the foregoing processor may further execute the following program code: determining that the backup data is stored in the local cache of the network card; and returning the backup data to the sending end.
  • the foregoing processor may further execute the following program code: determining that the target backup data is not stored in the local cache of the network card; and forwarding the first request message, acquiring the first corresponding to the first request message to the processor The response message, wherein the first response message carries the target data acquired from the preset storage area; and returns the target data to the sending end.
  • the foregoing processor may further execute the following program code: determining that the remaining storage space in the local cache of the network card is larger than the storage space required by the target data; and backing up the target data to the local cache.
  • the foregoing processor may further execute the following program code: record the storage duration of the backup data in the local cache; when the storage duration exceeds the first preset threshold, determine that the backup data has not been accessed; and clear the backup data.
  • the foregoing processor may further execute the following program code: statistics access frequency of the target data; when the access frequency is greater than the first preset threshold, the target data is backed up to the local cache.
  • the foregoing processor may further execute the following steps: receiving a second request message from the sending end, where the second request message is used to request to write data to the preset storage area; determining that the network card is stored in the local cache There is a data backup corresponding to the data to be written; the data backup is cleared, and the second request message is forwarded to the processor.
  • the above method is applicable to the network card.
  • the network card in the process of acquiring target data, the network card is used to forward the request message, send the request message to the CPU, and the CPU parses the request message to determine whether the request message is used. Requesting the data, and initiating the request to the database in the case of determining that the request message is used to request the data, and the solution provided by the present application performs the foregoing content in the network card, thereby reducing the operational burden of the CPU.
  • the network card also has a processing chip, and the processing chip buffers data of a part of the database, and can determine whether the cache in the network card includes backup data of the target data requested by the transmitting end, and determines a feedback manner of the target data according to the judgment result, thereby improving The speed at which data is fed back to the requester.
  • FIG. 10 is merely illustrative, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (Mobile Internet Devices, MID). ), PAD and other terminal devices.
  • FIG. 10 does not limit the structure of the above electronic device.
  • computer terminal 10 may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 10, or have a different configuration than that shown in FIG.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be used to save the program code executed by the acquiring method of the target data provided in the first embodiment.
  • the foregoing storage medium may be located in any one of the computer terminal groups in the computer network, or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: receiving a first request message from the sender, wherein the first request message is used to acquire target data; according to the local cache Whether the judgment result of the target data is stored or not, and the feedback mode of the target data is determined.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种目标数据的获取方法和装置。其中,该装置包括:网卡,网卡上配置有一个或多个处理芯片;网卡,用于接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问;网卡,用于根据网卡本地缓存中是否存储有目标数据的备份数据的判断结果,确定目标数据的反馈方式。本发明解决了现有技术由于获取数据的操作全部依赖CPU,导致CPU负担过重的技术问题。

Description

目标数据的获取方法和装置
本申请要求2017年10月11日递交的申请号为201710943640.X、发明名称为“目标数据的获取方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及数据处理领域,具体而言,涉及一种目标数据的获取方法和装置。
背景技术
数据库(Database)是按照数据结构来组织、存储和管理数据的仓库。一个IT系统中的主要数据都存在数据库中,以购物网站为例,购物网站的买家信息、卖家信息、商品信息以及账单信息等数据均存储于网站服务器的数据库中。系统中数据库的查询操作非常频繁,例如,在购物网站上点击某个商品的信息时,后台服务器需要查询位于数据库中的商品信息,然后呈现至前端设备。
具体的,访问数据库的请求通常从网络中获取。图1是根据现有技术的一种查询数据的示意图,该查询过程为:
S11,请求端发出查询请求,数据库所在的服务器网卡收到网络报文。
S12,网卡将网络报文交给CPU(Central Processing Unit,中央处理器)。
S13,CPU解析网络报文中的协议类型、内容,并判断是否为数据库查询请求。
S14,如果是,从存储器中读出要查询的数据。
S15,CPU将数据封装成网络报文。
S16,将网络报文返回至网卡。
S17,网卡发出网络报文。
由上可知,在现有技术方案中,无论采用哪种加速技术,CPU都需要执行以下工作:(1)网络报文的解析。需要CPU来判断网络报文中携带的是否是sql请求,如果是,该sql请求需要查询哪些数据。(2)读数据。即便数据被缓存,也由CPU来完成读数据的操作。(3)将结果封装在网络报文内。查询出结果后,CPU将结果按照协议格式封装在网络报文内,并且发给网卡。因此,数据查询的过程几乎全部依赖CPU来完成。
针对现有技术由于获取数据的操作全部依赖CPU,导致CPU负担过重的问题,目前 尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种目标数据的获取方法和装置,以至少解决现有技术由于获取数据的操作全部依赖CPU,导致CPU负担过重的技术问题。
根据本发明实施例的一个方面,提供了一种目标数据的获取装置,包括:网卡,所述网卡上配置有一个或多个处理芯片;所述网卡,用于接收来自于发送端的第一请求消息,其中,所述第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问;所述网卡,用于根据网卡本地缓存中是否存储有所述目标数据的备份数据的判断结果,确定所述目标数据的反馈方式。
根据本发明实施例的另一方面,还提供了一种目标数据的获取方法,包括:接收来自于发送端的第一请求消息,其中,所述第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对所述预设存储区域进行访问;根据网卡本地缓存中是否存储有所述目标数据的备份数据的判断结果,确定所述目标数据的反馈方式。
在现有技术中,在获取目标数据的过程中,网卡用于转发请求消息,将请求消息发送至CPU,由CPU对请求消息进行解析,确定该请求消息是否用于请求数据,并在确定请求消息用于请求数据的情况下向数据库发起请求,而在本发明实施例中,由网卡中执行上述内容,从而减小了CPU的运行负担,进一步的,本申请上述实施例中的网卡还具有处理芯片,处理芯片缓存了部分数据库的数据,可以判断网卡中的缓存是否包括发送端所请求的目标数据的备份数据,并根据判断结果来确定目标数据的反馈方式,从而提高了向请求端反馈数据的速度。
由此,本申请提供的上述方案解决了现有技术由于获取数据的操作全部依赖CPU,导致CPU负担过重的技术问题。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据现有技术的一种查询数据的示意图;
图2是根据本申请实施例的一种获取目标数据的获取装置的示意图;
图3是根据本申请实施例的一种FPGA智能网卡的示意图;
图4是根据本申请实施例的一种可选的获取数据的系统的示意图;
图5示出了一种用于实现目标数据的获取方法的计算机终端(或移动设备)的硬件结构框图;
图6是根据本申请实施例的一种目标数据的获取方法的流程图;
图7是根据本申请实施例的一种网卡接收发送端发出的网络数据包的处理方法的流程图;
图8是根据本申请实施例的一种网卡接收处理器发出的数据包的处理方法的流程图;
图9是根据本申请实施例的一种系统的示意图;以及
图10是根据本发明实施例的一种计算机终端的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本申请实施例进行描述的过程中出现的部分名词或术语适用于如下解释:
FPGA:Field-Programmable Gate Array,现场可编程门阵列,已并行运算为主,以硬件描述语言来实现的数字逻辑电路集成芯片。
实施例1
现有技术中在获取数据库中的数据时,需要通过服务器来根据请求中的信息向数据 库请求数据,并把请求得到的数据进行打包后,通过网卡返回给请求发送端,也即这一获取数据的过程主要依赖处理器来实现,导致处理器压力过大,运行负担中,当数据请求过多时,会降低处理器的运行速度。
为了解决从数据库获取数据时处理器负担过重的问题,本申请提供了一种获取目标数据的获取装置,具体如图2所示,该装置包括:网卡20,网卡上配置有一个或多个处理芯片22;
网卡,用于接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问;
网卡,用于根据网卡本地缓存中是否存储有目标数据的备份数据的判断结果,确定目标数据的反馈方式。
具体的,上述处理芯片可以是FPGA芯片,发送端可以是请求目标数据的终端。在一种可选的实施例中,用户在购物网站上点击商品详情,即用户通过终端向购物网站的网卡发送了第一请求消息,该第一请求消息所请求的目标数据即为用户点击的商品的详情信息,例如:商品的金额、尺寸、材料、评论信息等,而购物网站中用于存储数据的数据库可以是预设存储区域。
上述本地缓存可以是网卡上配置的一个或多个处理芯片在网卡上构成的缓存区域。目标数据的反馈方式可以是由网卡直接向发送端返回,或由网卡继续向数据库请求后,再向发送端返回。在一种可选的实施例中,如果本地缓存中存储有目标数据的备份数据,则网卡将缓存中的备份数据取出,直接返回给接收端;如果本地缓存中未存储备份数据,则网卡将第一请求消息继续发送至数据库,向数据库请求目标数据。
图3是根据本申请实施例的一种FPGA智能网卡的示意图,结合图3所示,网卡中集成有FPGA芯片,FPGA芯片与网卡芯片中存在用于传输数据的数据通道,FPGA芯片可以通过以太网接口与发送端通信,网卡芯片可以通过PCI-E接口(PCI Express接口)与处理器通信。由于在网卡的数据通路中加入了处理芯片,因此可以通过对处理芯片进行编程来决定对数据包如何进行处理,而在本申请实施例中,由处理芯片根据网卡的地缓存中是否存储有目标数据来确定目标数据的反馈方式。
此处需要说明的是,在现有技术中,在获取目标数据的过程中,网卡用于转发请求消息,将请求消息发送至CPU,由CPU对请求消息进行解析,确定该请求消息是否用于请求数据,并在确定请求消息用于请求数据的情况下向数据库发起请求,而本申请提供的方案在网卡中执行上述内容,从而减小了CPU的运行负担,进一步的,本申请上述实 施例中的网卡还具有处理芯片,处理芯片缓存了部分数据库的数据,可以判断网卡中的缓存是否包括发送端所请求的目标数据的备份数据,并根据判断结果来确定目标数据的反馈方式,从而提高了向请求端反馈数据的速度。
由此,本申请提供的上述方案解决了现有技术由于获取数据的操作全部依赖CPU,导致CPU负担过重的技术问题。
作为一种可选的实施例,上述网卡还用于确定网卡本地缓存中存储有备份数据,以及将备份数据返回至发送端。
在一种可选的实施例中,当网卡接收到发送端发送的数据包时,由处理芯片解析数据包,判断数据包是否为数据库请求,即第一消息请求,如果数据包为数据库请求,则判断网卡本地缓存中是否包括第一消息请求所请求的目标数据对应的备份数据,在网卡的本地缓存包括第一消息请求所请求的目标数据的备份数据情况下,将本地缓存中的目标数据的备份数据返回至发送端,完成对第一消息请求中的响应。
在上述实施例中,如果目标数据在网卡的本地数据库中,那么本次请求不需要交给CPU,而是由智能网卡来直接将备份数据封装,并且返回网络报文,不需要被交给处理器,简化了数据处理环节,降低了延迟,提高了数据库的性能。
作为一种可选的实施例,上述网卡还用于确定网卡本地缓存中未存储有备份数据,通过将第一请求消息转发至处理器,向处理器获取与第一请求消息对应的第一响应消息,其中,处理器与网卡相耦合,第一响应消息中携带有从预设存储区域获取到的目标数据;
网卡,还用于将目标数据返回至发送端。
具体的,上述处理器可以为CPU。图4是根据本申请实施例的一种可选的获取数据的系统的示意图,在该示例中网卡为FPGA智能网卡为例,在一种可选的实施例中,当网卡接收到发送端发送的数据包时,由处理芯片解析数据包,判断数据包是否为数据库请求,即第一消息请求,如果数据包是否为数据库请求,则判断本地缓存中是否包括第一消息请求所请求的目标数据,在网卡的本地缓存不包括第一消息请求所请求的目标数据的情况下,网卡将第一请求消息发送至处理器,由处理器向数据库请求目标数据,并将目标数据封装后通过第一响应消息返回至发送端。
在上述第一种目标数据的反馈方式中,由于网卡的本地缓存中包括第一请求消息中目标数据的备份数据,处理器在这一过程中无需执行任何操作,在上述第二种目标数据的反馈方式中,由于网卡的本地缓存中不包括第一消息请求中目标数据的备份数据,需要将第一消息请求转发至处理器,由处理器向数据库请求目标数据,因此只有在这一过 程中需要处理器执行相应的操作。由此可知,处理器的不需要对所有获取目标数据的请求作出响应,从而达到了减轻处理器负担的目的。
作为一种可选的实施例,上述网卡还用于确定网卡本地缓存中的剩余存储空间大于目标数据所需占用的存储空间,以及将目标数据备份至本地缓存。
在一种可选的实施例中,如果网卡收到处理器发出的网络报文,网卡中的处理芯片对网络报文进行解析,判断其是否为针对某个第一请求消息的响应,如果是,则说明该网络报文中包含第一请求消息所请求的目标数据,此时,处理芯片判断网卡对本地缓存的剩余存储空间是否允许存目标数据的备份数据,如果允许,则将这目标数据备份至本地缓存。如果不允许,则直接将处理器发出的网络报文发到网卡的以太网接口。
作为一种可选的实施例,上述网卡还用于确定当备份数据在本地缓存中的存储时长超过第一预设阈值时,备份数据一直未被访问,则清除备份数据。
在一种可选的实施例中,处理芯片在每接收到一个目标数据时开始计数,如果备份数据在计时超过低于预设阈值时仍未被再次访问,在将其清除出网卡的本地缓存。
上述方案在网卡接收到目标数据后都将其进行备份,如果超过第一预设阈值的时间之后仍没有被访问,则确认这个目标数据被访问的频次较低,可以将其备份数据清除。对每一个目标数据都进行这样的处理,从而能够使得网卡的本地缓存中所保存的都是访问频次较高的目标数据的备份数据,进而进一步的减少对处理器的访问此处,减少处理器的压力。
作为一种可选的实施例,上述网卡还用于统计目标数据的访问频次,以及在访问频次大于第二预设阈值时,将目标数据备份至本地缓存中。
上述方案根据目标数据的访问频次来确定是否将目标数据存储至本地缓存,由于网卡的本地缓存的存储区域有限,因此可以统计目标数据被访问的频次,目标数据被访问的频次超过第二预设值时,将其备份至网卡的本地缓存中。
作为一种可选的实施例,上述网卡还用于接收来自于发送端的第二请求消息,其中,第二请求消息用于请求向预设存储区域写入数据;以及如果确定网卡本地缓存中存储有与待写入数据对应的数据备份,则清除数据备份,并向处理器转发第二请求消息。
在一种可选的实施例中,网卡接收到包括写操作的网络报文,写操作中指示将更新的商品数量参数number=10写入数据库,判断网卡的本地缓存是否存储有该数据的备份数据,如果存有商品数量参数number的备份数据,则由于有新的商品数量参数number写入,确认网卡的本地缓存中所存储的商品数量参数number的备份数据无效,将其删除, 并将商品数量参数number传输至处理器,以写入数据库。
实施例2
根据本发明实施例,还提供了一种目标数据的获取方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。图5示出了一种用于实现目标数据的获取方法的计算机终端(或移动设备)的硬件结构框图。如图5所示,计算机终端50(或移动设备50)可以包括一个或多个(图中采用502a、502b,……,502n来示出)处理器502(处理器502可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器504、以及用于通信功能的传输模块506。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为I/O接口的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图5所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端50还可包括比图5中所示更多或者更少的组件,或者具有与图5所示不同的配置。
应当注意到的是上述一个或多个处理器502和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到计算机终端50(或移动设备)中的其他元件中的任意一个内。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。
存储器504可用于存储应用软件的软件程序以及模块,如本发明实施例中的目标数据的获取方法对应的程序指令/数据存储装置,处理器502通过运行存储在存储器504内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的目标数据的获取方法。存储器504可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器504可进一步包括相对于处理器502远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端50。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置506用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端50的通信供应商提供的无线网络。在一个实例中,传输装置506包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置506可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与计算机终端50(或移动设备)的用户界面进行交互。
此处需要说明的是,在一些可选实施例中,上述图5所示的计算机设备(或移动设备)可以包括硬件元件(包括电路)、软件元件(包括存储在计算机可读介质上的计算机代码)、或硬件元件和软件元件两者的结合。应当指出的是,图5仅为特定具体实例的一个实例,并且旨在示出可存在于上述计算机设备(或移动设备)中的部件的类型。
在上述运行环境下,本申请提供了如图6所示的目标数据的获取方法。图6是根据本申请实施例的一种目标数据的获取方法的流程图。
步骤S61,接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问。
具体的,可以由网卡来,接收来自于发送端的第一请求消息。
步骤S63,根据网卡本地缓存中是否存储有目标数据的备份数据的判断结果,确定目标数据的反馈方式。
上述本地缓存可以是网卡上配置的一个或多个处理芯片在网卡上构成的缓存区域。目标数据的反馈方式可以是由网卡直接向发送端返回,或由网卡继续向数据库请求后,再向发送端返回。在一种可选的实施例中,如果本地缓存中存储有目标数据的备份数据,则网卡将缓存中的备份数据取出,直接返回给接收端;如果本地缓存中未存储目标数据的备份数据,则网卡将第一请求消息继续发送至数据库,向数据库请求目标数据。
作为一种可选的实施例,根据网卡本地缓存中是否存储有目标数据的判断结果,确定备份数据的反馈方式包括:确定网卡本地缓存中存储有备份数据;将备份数据返回至发送端。
作为一种可选的实施例,根据网卡本地缓存中是否存储有目标数据的判断结果,确定目标数据的反馈方式还包括:确定网卡本地缓存中未存储有备份数据;通过对第一请求消息进行转发,向处理器获取与第一请求消息对应的第一响应消息,其中,第一响应消息中携带有从预设存储区域获取到的目标数据;将目标数据返回至发送端。
作为一种可选的实施例,在将目标数据返回至发送端之前,确定网卡本地缓存中的剩余存储空间大于目标数据所需占用的存储空间;将目标数据备份至本地缓存。
作为一种可选的实施例,在将目标数据备份至本地缓存之后,记录备份数据在本地缓存中的存储时长;在存储时长超过第一预设阈值时,确定备份数据一直未被访问;清除备份数据。
作为一种可选的实施例,在根据网卡本地缓存中是否存储有备份数据的判断结果,确定目标数据的反馈方式之前,统计目标数据的访问频次;在访问频次大于第一预设阈值时,将目标数据备份至本地缓存中。
作为一种可选的实施例,在根据网卡本地缓存中是否存储有备份数据的判断结果,确定目标数据的反馈方式之后,还包括:接收来自于发送端的第二请求消息,其中,第二请求消息用于请求向预设存储区域写入数据;确定网卡本地缓存中存储有与待写入数据对应的数据备份;清除数据备份,并向处理器转发第二请求消息。
作为一种可选的实施例,上述方法适用于网卡。
图7是根据本申请实施例的一种网卡接收发送端发出的网络数据包的处理方法的流程图,下面结合图7所示,对申请实施例中的目标数据的获取方法进行描述。
S71,收到网络数据包。具体的,上述网络数据包由发送端生成。
S72,是否为读数据的数据包。在网络数据包为读数据的数据包的情况下,进入步骤S73,否则进入步骤S75。
S73,本地缓存中是否包含目标数据的备份数据。在本地缓存中包含目标数据的备份数据的情况下,进入步骤S74,否则进入步骤S78。
S74,读取本地缓存中的备份数据,并对备份数据进行封装后返回。
在网卡的本地缓存中存储有目标数据的备份数据的情况下,可以由网卡中的处理芯片对备份数据进行封装后返回至发送端。
S75,是否为写数据的数据包,在网络数据包为写数据的数据包的情况下,进入步骤S76,否则进入步骤S78。
S76,网卡本地缓存是否存储有待写入数据的备份数据。如果本地缓存中存储有待写入数据的备份数据,则进入步骤S77,否则进入步骤S78。
S77,从本地缓存中清除待写入数据对应的备份数据。
在网卡的本地缓存中存储有待写入数据对应的备份数据的情况下,可以确认当前本地缓存中所存储的待写入数据对应的备份数据为失效数据,因此将其从本地缓存中清除。
S78,将数据包转发至处理器。
在网卡的本地缓存中未存储有目标数据的备份数据的情况下,网卡将网络数据包发送至处理器,由处理器向数据库请求目标数据,并由处理器将数据库返回的数据进行封装,再经过网卡返回至发送端。
在网络数据包既不为读数据的数据包,也不为写数据的数据包的情况,网卡将网络数据包括发送至处理器,由处理器进行相应处理。
在网卡的本地缓存中未存储有待写入数据对应的备份数据的情况下,将待写入数据发送至服务器,由服务器将待写入数据备份至数据库。
图8是根据本申请实施例的一种网卡接收处理器发出的数据包的处理方法的流程图,下面结合图8所示,对申请实施例中的目标数据的获取方法进行描述。
S81,收到处理器发送的数据包。具体的,上述处理器可以为CPU。
S82,是否为读数据库操作的返回数据。如果数据包为读数据库操作的返回数据,则进入步骤S83,否则进入步骤S85。
S83,本地缓存中是否还有足够的存储空间。如果本地缓存中还具有足够的存储空间,则进入步骤S84,否则进入步骤S85。
S84,将数据包中的数据备份至本地缓存。将数据包中的数据备份至本地缓存之后,当网卡再次接收到该数据的读数据指令,则无需通过服务器向数据库请求,而是直接从本地缓存中取出发送给发送端即可。
S85,将数据包发送至网口。
在本地缓存中不具有足够的存储空间的情况下,直接将数据包发送至网口。
在数据包不为读数据操作的返回数据的情况下,直接将数据包发送至网口。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个 存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
实施例3
根据本发明实施例,还提供了一种系统,如图9所示,该系统包括:
处理器90;以及
存储器92,与处理器连接,用于为处理器提供执行以下处理过程的指令:
接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问;
根据网卡本地缓存中是否存储有目标数据的备份数据的判断结果,确定目标数据的反馈方式。
具体的,上述处理器还可以执行如实施例1中的其他步骤,此处不再赘述。
实施例4
本发明的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行目标数据的获取方法中以下步骤的程序代码:接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问;根据网卡本地缓存中是否存储有目标数据的备份数据的判断结果,确定目标数据的反馈方式。
可选地,图10是根据本发明实施例的一种计算机终端的结构框图。如图10所示,该计算机终端A可以包括:一个或多个(图中仅示出一个)处理器1002、存储器1004、以及外设接口1006。
其中,存储器可用于存储软件程序以及模块,如本发明实施例中的目标数据的获取方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的目标数据的获取方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端A。上述网络的实例包 括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据,目标数据存储于预设存储区域并通过处理器对预设存储区域进行访问;根据网卡本地缓存中是否存储有目标数据的备份数据的判断结果,确定目标数据的反馈方式。
可选的,上述处理器还可以执行如下步骤的程序代码:确定网卡本地缓存中存储有备份数据;将备份数据返回至发送端。
可选的,上述处理器还可以执行如下步骤的程序代码:确定网卡本地缓存中未存储有目备份数据;通过对第一请求消息进行转发,向处理器获取与第一请求消息对应的第一响应消息,其中,第一响应消息中携带有从预设存储区域获取到的目标数据;将目标数据返回至发送端。
可选的,上述处理器还可以执行如下步骤的程序代码:确定网卡本地缓存中的剩余存储空间大于目标数据所需占用的存储空间;将目标数据备份至本地缓存。
可选的,上述处理器还可以执行如下步骤的程序代码:记录备份数据在本地缓存中的存储时长;在存储时长超过第一预设阈值时,确定备份数据一直未被访问;清除备份数据。
可选的,上述处理器还可以执行如下步骤的程序代码:统计目标数据的访问频次;在访问频次大于第一预设阈值时,将目标数据备份至本地缓存中。
可选的,上述处理器还可以执行如下步骤的程序代码:接收来自于发送端的第二请求消息,其中,第二请求消息用于请求向预设存储区域写入数据;确定网卡本地缓存中存储有与待写入数据对应的数据备份;清除数据备份,并向处理器转发第二请求消息。
上述方法适用于网卡。
此处需要说明的是,在现有技术中,在获取目标数据的过程中,网卡用于转发请求消息,将请求消息发送至CPU,由CPU对请求消息进行解析,确定该请求消息是否用于请求数据,并在确定请求消息用于请求数据的情况下向数据库发起请求,而本申请提供的方案在网卡中执行上述内容,从而减小了CPU的运行负担,进一步的,本申请上述实施例中的网卡还具有处理芯片,处理芯片缓存了部分数据库的数据,可以判断网卡中的缓存是否包括发送端所请求的目标数据的备份数据,并根据判断结果来确定目标数据的反馈方式,从而提高了向请求端反馈数据的速度。
由此,本申请提供的上述方案解决了现有技术由于获取数据的操作全部依赖CPU, 导致CPU负担过重的技术问题。
本领域普通技术人员可以理解,图10所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图10其并不对上述电子装置的结构造成限定。例如,计算机终端10还可包括比图10中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图10所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
实施例5
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的目标数据的获取方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:接收来自于发送端的第一请求消息,其中,第一请求消息用于获取目标数据;根据本地缓存中是否存储有目标数据的判断结果,确定目标数据的反馈方式。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的 目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。

Claims (18)

  1. 一种目标数据的获取装置,其特征在于,包括:网卡,所述网卡上配置有一个或多个处理芯片;
    所述网卡,用于接收来自于发送端的第一请求消息,其中,所述第一请求消息用于获取目标数据,所述目标数据存储于预设存储区域并通过处理器对所述预设存储区域进行访问;
    所述网卡,用于根据网卡本地缓存中是否存储有所述目标数据的备份数据的判断结果,确定所述目标数据的反馈方式。
  2. 根据权利要求1所述的装置,其特征在于,所述网卡,还用于确定所述网卡本地缓存中存储有所述备份数据,以及将所述备份数据返回至所述发送端。
  3. 根据权利要求1所述的装置,其特征在于,所述网卡,还用于确定所述网卡本地缓存中未存储有所述备份数据,通过将所述第一请求消息转发至处理器,向所述处理器获取与所述第一请求消息对应的第一响应消息,其中,所述处理器与所述网卡相耦合,所述第一响应消息中携带有从预设存储区域获取到的所述目标数据;
    所述网卡,还用于将所述目标数据返回至所述发送端。
  4. 根据权利要求3所述的装置,其特征在于,所述网卡,还用于确定所述网卡本地缓存中的剩余存储空间大于所述目标数据所需占用的存储空间,以及将所述目标数据备份至所述本地缓存。
  5. 根据权利要求4所述的装置,其特征在于,所述网卡,还用于确定当所述备份数据在所述本地缓存中的存储时长超过第一预设阈值时,所述备份数据一直未被访问,则清除所述备份数据。
  6. 根据权利要求1所述的装置,其特征在于,所述网卡,还用于统计所述目标数据的访问频次,以及在所述访问频次大于第二预设阈值时,将所述目标数据备份至所述本地缓存中。
  7. 根据权利要求1所述的装置,其特征在于,所述网卡,还用于接收来自于所述发送端的第二请求消息,其中,所述第二请求消息用于请求向所述预设存储区域写入数据;以及如果确定所述网卡本地缓存中存储有与待写入数据对应的数据备份,则清除所述数据备份,并向所述处理器转发所述第二请求消息。
  8. 一种目标数据的获取方法,其特征在于,包括:
    接收来自于发送端的第一请求消息,其中,所述第一请求消息用于获取目标数据, 所述目标数据存储于预设存储区域并通过处理器对所述预设存储区域进行访问;
    根据网卡本地缓存中是否存储有所述目标数据的备份数据的判断结果,确定所述目标数据的反馈方式。
  9. 根据权利要求8所述的方法,其特征在于,根据所述网卡本地缓存中是否存储有所述备份数据的判断结果,确定所述目标数据的反馈方式包括:
    确定所述网卡本地缓存中存储有所述备份数据;
    将所述备份数据返回至所述发送端。
  10. 根据权利要求8所述的方法,其特征在于,根据所述网卡本地缓存中是否存储有所述备份数据的判断结果,确定所述目标数据的反馈方式包括:
    确定所述网卡本地缓存中未存储有所述备份数据;
    通过对所述第一请求消息进行转发,向所述处理器获取与所述第一请求消息对应的第一响应消息,其中,所述第一响应消息中携带有从所述预设存储区域获取到的所述目标数据;
    将所述目标数据返回至所述发送端。
  11. 根据权利要求10所述的方法,其特征在于,在将所述目标数据返回至所述发送端之前,还包括:
    确定所述网卡本地缓存中的剩余存储空间大于所述目标数据所需占用的存储空间;
    将所述目标数据备份至所述本地缓存。
  12. 根据权利要求11所述的方法,其特征在于,在将所述目标数据备份至所述本地缓存之后,还包括:
    记录所述备份数据在所述本地缓存中的存储时长;
    在所述存储时长超过第一预设阈值时,确定所述备份数据一直未被访问;
    清除所述备份数据。
  13. 根据权利要求8所述的方法,其特征在于,在根据所述网卡本地缓存中是否存储有所述备份数据的判断结果,确定所述目标数据的反馈方式之前,还包括:
    统计所述目标数据的访问频次;
    在所述访问频次大于第二预设阈值时,将所述目标数据备份至所述本地缓存中。
  14. 根据权利要求8所述的方法,其特征在于,在根据所述网卡本地缓存中是否存储有所述备份数据的判断结果,确定所述目标数据的反馈方式之后,还包括:
    接收来自于所述发送端的第二请求消息,其中,所述第二请求消息用于请求向所述 预设存储区域写入数据;
    确定所述网卡本地缓存中存储有与待写入数据对应的数据备份;
    清除所述数据备份,并向所述处理器转发所述第二请求消息。
  15. 根据权利要求8至14中任一项所述的方法,其特征在于,所述方法适用于网卡。
  16. 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行权利要求8至14中任意一项所述的目标数据的获取方法。
  17. 一种处理器,其特征在于,所述处理器用于运行程序,其中,所述程序运行时执行权利要求8至14中任意一项所述的目标数据的获取方法。
  18. 一种系统,其特征在于,包括:
    处理器;以及
    存储器,与所述处理器连接,用于为所述处理器提供执行以下处理过程的指令:
    接收来自于发送端的第一请求消息,其中,所述第一请求消息用于获取目标数据,所述目标数据存储于预设存储区域并通过处理器对所述预设存储区域进行访问;
    根据网卡本地缓存中是否存储有所述目标数据的备份数据的判断结果,确定所述目标数据的反馈方式。
PCT/CN2018/108306 2017-10-11 2018-09-28 目标数据的获取方法和装置 WO2019072103A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710943640.XA CN109947795A (zh) 2017-10-11 2017-10-11 目标数据的获取方法和装置
CN201710943640.X 2017-10-11

Publications (1)

Publication Number Publication Date
WO2019072103A1 true WO2019072103A1 (zh) 2019-04-18

Family

ID=66100388

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108306 WO2019072103A1 (zh) 2017-10-11 2018-09-28 目标数据的获取方法和装置

Country Status (2)

Country Link
CN (1) CN109947795A (zh)
WO (1) WO2019072103A1 (zh)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990483A (zh) * 2019-11-26 2020-04-10 上海莉莉丝科技股份有限公司 分布式缓存中的缓存节点的数据访问和控制方法及系统
CN111107019A (zh) * 2019-12-29 2020-05-05 浪潮电子信息产业股份有限公司 一种数据传输方法、装置、设备及计算机可读存储介质
CN111353773A (zh) * 2020-02-24 2020-06-30 网银在线(北京)科技有限公司 标识的处理方法和装置、存储介质、电子装置
CN111414383A (zh) * 2020-02-21 2020-07-14 车智互联(北京)科技有限公司 数据请求方法、数据处理系统及计算设备
CN111913765A (zh) * 2020-08-17 2020-11-10 中消云(北京)物联网科技研究院有限公司 数据请求处理方法
CN112417022A (zh) * 2020-11-27 2021-02-26 深圳市金证科技股份有限公司 用于获取数据的方法、装置、终端及存储介质
CN113177091A (zh) * 2021-05-19 2021-07-27 杭州华橙软件技术有限公司 增量数据的存储方法及装置、存储介质、电子装置
CN114844740A (zh) * 2022-04-29 2022-08-02 东风电驱动系统有限公司 双芯片间通信方法及芯片
CN116661706A (zh) * 2023-07-26 2023-08-29 江苏华存电子科技有限公司 一种固态硬盘的缓存清理分析方法及系统
CN112417022B (zh) * 2020-11-27 2024-06-07 深圳市金证科技股份有限公司 用于获取数据的方法、装置、终端及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949273B (zh) * 2020-07-31 2023-04-07 深圳市艾特云信息技术有限公司 一种基于iOS系统的文件提取方法及装置
CN113360318B (zh) * 2021-04-22 2022-11-15 山东英信计算机技术有限公司 一种资料备份方法、系统、存储介质及设备
CN114338808A (zh) * 2021-12-17 2022-04-12 苏州浪潮智能科技有限公司 一种数据管理方法及装置、服务器

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030070044A1 (en) * 2001-10-04 2003-04-10 Joseph Jeddeloh Embedded DRAM cache memory and method having reduced latency
CN1992610A (zh) * 2005-12-31 2007-07-04 中国科学院计算技术研究所 具有硬件加速功能的智能以太网卡
CN102244579A (zh) * 2010-05-12 2011-11-16 北京研华兴业电子科技有限公司 网卡及网络数据接收方法
CN103441948A (zh) * 2013-07-03 2013-12-11 华为技术有限公司 一种数据访问方法、网卡及存储系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752119B (zh) * 2012-07-09 2015-06-24 南京中新赛克科技有限责任公司 一种智能网卡的接口实现方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030070044A1 (en) * 2001-10-04 2003-04-10 Joseph Jeddeloh Embedded DRAM cache memory and method having reduced latency
CN1992610A (zh) * 2005-12-31 2007-07-04 中国科学院计算技术研究所 具有硬件加速功能的智能以太网卡
CN102244579A (zh) * 2010-05-12 2011-11-16 北京研华兴业电子科技有限公司 网卡及网络数据接收方法
CN103441948A (zh) * 2013-07-03 2013-12-11 华为技术有限公司 一种数据访问方法、网卡及存储系统

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990483A (zh) * 2019-11-26 2020-04-10 上海莉莉丝科技股份有限公司 分布式缓存中的缓存节点的数据访问和控制方法及系统
CN111107019A (zh) * 2019-12-29 2020-05-05 浪潮电子信息产业股份有限公司 一种数据传输方法、装置、设备及计算机可读存储介质
CN111414383A (zh) * 2020-02-21 2020-07-14 车智互联(北京)科技有限公司 数据请求方法、数据处理系统及计算设备
CN111414383B (zh) * 2020-02-21 2024-03-15 车智互联(北京)科技有限公司 数据请求方法、数据处理系统及计算设备
CN111353773B (zh) * 2020-02-24 2024-01-16 网银在线(北京)科技有限公司 标识的处理方法和装置、存储介质、电子装置
CN111353773A (zh) * 2020-02-24 2020-06-30 网银在线(北京)科技有限公司 标识的处理方法和装置、存储介质、电子装置
CN111913765A (zh) * 2020-08-17 2020-11-10 中消云(北京)物联网科技研究院有限公司 数据请求处理方法
CN112417022A (zh) * 2020-11-27 2021-02-26 深圳市金证科技股份有限公司 用于获取数据的方法、装置、终端及存储介质
CN112417022B (zh) * 2020-11-27 2024-06-07 深圳市金证科技股份有限公司 用于获取数据的方法、装置、终端及存储介质
CN113177091A (zh) * 2021-05-19 2021-07-27 杭州华橙软件技术有限公司 增量数据的存储方法及装置、存储介质、电子装置
CN113177091B (zh) * 2021-05-19 2023-10-10 杭州华橙软件技术有限公司 增量数据的存储方法及装置、存储介质、电子装置
CN114844740B (zh) * 2022-04-29 2024-01-30 东风电驱动系统有限公司 双芯片间通信方法及芯片
CN114844740A (zh) * 2022-04-29 2022-08-02 东风电驱动系统有限公司 双芯片间通信方法及芯片
CN116661706B (zh) * 2023-07-26 2023-11-14 江苏华存电子科技有限公司 一种固态硬盘的缓存清理分析方法及系统
CN116661706A (zh) * 2023-07-26 2023-08-29 江苏华存电子科技有限公司 一种固态硬盘的缓存清理分析方法及系统

Also Published As

Publication number Publication date
CN109947795A (zh) 2019-06-28

Similar Documents

Publication Publication Date Title
WO2019072103A1 (zh) 目标数据的获取方法和装置
US20140330992A1 (en) USB Device Communication Method, Device and System
CN107770746B (zh) 数据处理方法和装置、计算机设备、计算机可读存储介质
CN110765395B (zh) 一种用于提供小说信息的方法与设备
EP3079330B1 (en) Method for wireless access of memory device, and mobile hotspot device
CN107708084B (zh) 数据处理方法和装置、计算机设备、计算机可读存储介质
WO2019140777A1 (zh) 移动终端app数据的请求方法、装置、设备及存储介质
TW542971B (en) Automatic data backup system and method for portable electronic device
US11611620B2 (en) Method and system for triggering an online interaction in connection with a physical product
CN112104663B (zh) 一种用于管理登录用户和用户设备的方法与设备
WO2019100853A1 (zh) 分页查询方法及装置和电子设备
US20240095210A1 (en) Data Transmission Method, Electronic Device, and Computer-Readable Storage Medium
CN104537049B (zh) 一种图片浏览方法及装置
CN108462590B (zh) 网络流量的监控方法及装置、计算机终端
WO2019144803A1 (zh) 流量统计方法、装置、存储介质及电子装置
CN111694703A (zh) 缓存区管理方法、装置和计算机设备
CN110515662B (zh) 双系统设备的远程控制方法、系统、设备及可读存储介质
CN103699699B (zh) 一种浏览解码话单文件方法
CN107682892B (zh) 流量控制方法和装置、计算机设备、计算机可读存储介质
WO2020107168A1 (zh) 视频解码方法、装置、电子设备、计算机可读存储介质
CN104796519A (zh) 一种终端
WO2020221033A1 (zh) 管理设备对远端存储设备进行管理的方法
CN104811529A (zh) 移动终端或应用按照运动模式进行智能处理的方法
CN113326302A (zh) 数据查询方法及装置、存储介质
CN107491242A (zh) 应用图标管理方法、装置及用户终端

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18866143

Country of ref document: EP

Kind code of ref document: A1