CN110704733B - Method and device for sending data - Google Patents

Method and device for sending data Download PDF

Info

Publication number
CN110704733B
CN110704733B CN201910892672.0A CN201910892672A CN110704733B CN 110704733 B CN110704733 B CN 110704733B CN 201910892672 A CN201910892672 A CN 201910892672A CN 110704733 B CN110704733 B CN 110704733B
Authority
CN
China
Prior art keywords
data
subset
target
placeholder
offset
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.)
Active
Application number
CN201910892672.0A
Other languages
Chinese (zh)
Other versions
CN110704733A (en
Inventor
孟春晨
张悦
苏鑫
靳猛
洪璐
鲍晖
汪强
陶晓斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201910892672.0A priority Critical patent/CN110704733B/en
Publication of CN110704733A publication Critical patent/CN110704733A/en
Application granted granted Critical
Publication of CN110704733B publication Critical patent/CN110704733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The specification discloses a method and a device for sending data, wherein before data is acquired according to an acquisition request of a terminal, a source of each data in a target data subset corresponding to the acquisition request is determined by setting a placeholder; and then acquiring the data corresponding to the acquisition request from the data corresponding to the full set identifier according to the data source recorded in the placeholder corresponding to each data in the target data subset. The method in this embodiment of the present description can acquire the data corresponding to the acquisition request under the condition that the number of data included in the target data subset corresponding to the acquisition request and the source of each data in the target data subset are known, so that each acquired data is the data corresponding to the acquisition request, and each acquired data is returned to the terminal corresponding to the acquisition request, which does not cause the problem of data redundancy.

Description

Method and device for sending data
Technical Field
The present disclosure relates to the field of internet, and in particular, to a method and an apparatus for transmitting data.
Background
At present, with the rapid development of new technological revolution represented by information and communication technology, the application of the internet has been expanded to many fields of social life.
In the prior art, for example, in a scenario where a terminal acquires target data from multiple data sources through a server, after receiving a request from the terminal, the server acquires to-be-processed data, which is equal to the target data, from each data source according to an amount of the target data corresponding to the request, and then the total amount of the to-be-processed data received by the server from each data source is significantly greater than an amount of the target data actually requested by the terminal. Then, the server extracts the data to be processed corresponding to the amount of the target data from the data to be processed according to a preset data extraction rule, the data to be processed is used as the target data and is sent to the terminal, and the data to be processed which is not extracted is discarded.
It can be seen that, in the method for sending data in the prior art, the total amount of the data to be processed, which is received by the server from each data source, is significantly greater than the amount of the target data actually requested by the terminal, thereby causing a data redundancy phenomenon. Further, under the condition that the number of the data sources corresponding to the server is large, for a request, the amount of the to-be-processed data acquired by the server will be larger, so that the amount of the to-be-processed data discarded finally is correspondingly increased, and the phenomenon of data redundancy is more serious.
Disclosure of Invention
The embodiments of the present specification provide a method and an apparatus for sending data, so as to partially solve the above problems in the prior art.
The embodiment of the specification adopts the following technical scheme:
a first method for transmitting data provided in this specification, the method including:
receiving an acquisition request aiming at a target data subset sent by a terminal, wherein the acquisition request comprises: a full set identifier of a full set of data to which the target subset of data belongs and a subset identifier of the target subset of data;
determining a placeholder corresponding to each data in the data full set corresponding to the full set identification;
sorting the placeholders corresponding to each datum according to a preset sorting rule;
dividing the sorted placeholders according to the sorted placeholders and a preset subset division rule to determine a data subset to which data corresponding to each sorted placeholder belongs;
determining a placeholder corresponding to the data belonging to the target data subset corresponding to the subset identification as a designated placeholder;
acquiring data corresponding to the designated placeholder in the data corresponding to the full set identifier;
and returning the target data subset corresponding to the acquired data to the terminal.
Optionally, the data corpus includes data stored in a plurality of data sources;
determining a placeholder corresponding to each data in the data corpus corresponding to the corpus identifier specifically includes:
for each data source, determining the quantity of data belonging to the data corpus contained in the data source;
generating the number of placeholders corresponding to the data source as placeholders corresponding to data contained in the data source that belongs to the data corpus.
Optionally, obtaining data corresponding to the designated placeholder from the data corresponding to the full set identifier specifically includes:
for each designated placeholder, determining a data source corresponding to the designated placeholder as a target data source;
determining the ordering of the target data subsets in each data subset;
determining the quantity of data belonging to the target data source contained in all data subsets before the sorting as a first offset;
determining a second offset according to the sequence of the data corresponding to the designated placeholder in all data belonging to the target data source contained in the target data subset;
and sending the first offset and the second offset to the target data source, so that the target data source determines the data corresponding to the designated placeholder according to the stored data belonging to the data corpus sorted by the target data source, the first offset and the second offset, and returning.
Optionally, returning the target data subset corresponding to the acquired data to the terminal, specifically including:
according to the preset sorting rule, sorting the acquired data corresponding to the designated placeholder to obtain a target data subset consisting of the sorted data;
and returning the target data subset to the terminal.
Optionally, the target data subset is a page;
the subset identification is a page number corresponding to the page.
A second method for transmitting data provided in this specification, the method including:
a target data source receives a data request sent by a server, wherein the data request comprises a full set identifier of a full set of data, a first offset and a second offset;
determining data which is stored in the target data source and belongs to the data corpus according to the corpus identification;
sequencing the determined data according to a preset sequencing rule aiming at the target data source;
determining data corresponding to the data request in the sorted data according to the sorted data, the first offset and the second offset;
and returning the determined data corresponding to the data request to the server.
A first apparatus for transmitting data provided in this specification, includes:
an obtaining request receiving module, configured to receive an obtaining request for a target data subset sent by a terminal, where the obtaining request includes: a full set identifier of a full set of data to which the target subset of data belongs and a subset identifier of the target subset of data;
a placeholder determining module, configured to determine a placeholder corresponding to each data in the data corpus corresponding to the corpus identifier;
the placeholder sorting module is used for sorting the placeholders corresponding to each piece of data according to a preset sorting rule;
the data subset determining module is used for dividing the sorted placeholders according to the sorted placeholders and a preset subset dividing rule so as to determine a data subset to which the data corresponding to each sorted placeholder belongs;
a designated placeholder determining module, configured to determine a placeholder corresponding to data belonging to the target data subset corresponding to the subset identifier, as a designated placeholder;
the data acquisition module is used for acquiring data corresponding to the designated placeholder from the data corresponding to the full set identifier;
and the sending module is used for returning the target data subset corresponding to the acquired data to the terminal.
A second apparatus for transmitting data provided in this specification, includes:
the data request receiving module is used for receiving a data request sent by a server, wherein the data request comprises a full set identifier of a full set of data, a first offset and a second offset;
the data screening module is used for determining data which are stored in the target data source and belong to the data corpus according to the corpus identification;
the data sorting module is used for sorting the determined data according to a preset sorting rule aiming at the target data source;
a data determining module, configured to determine, according to the sorted data, the first offset and the second offset, data corresponding to the data request in the sorted data;
and the data returning module is used for returning the determined data corresponding to the data request to the server.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the first method of transmitting data or the second method of transmitting data described above.
The present specification provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the first method for transmitting data or the second method for transmitting data.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
before acquiring data according to an acquisition request of a terminal, determining a source of each data in a target data subset corresponding to the acquisition request in a manner of setting a placeholder; and then acquiring the data corresponding to the acquisition request from the data corresponding to the full set identifier according to the data source recorded in the placeholder corresponding to each data in the target data subset. The method in this embodiment of the present description can acquire the data corresponding to the acquisition request under the condition that the number of data included in the target data subset corresponding to the acquisition request and the source of each data in the target data subset are known, so that each acquired data is the data corresponding to the acquisition request, and each acquired data is returned to the terminal corresponding to the acquisition request, which does not cause the problem of data redundancy.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
fig. 1 is a first process for transmitting data according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an exemplary network architecture provided by embodiments of the present description;
fig. 3 is a process of determining a target data subset according to a first offset and a second offset according to a first process of sending data provided in an embodiment of the present disclosure;
fig. 4 is a second process for sending data provided by an embodiment of the present specification;
fig. 5 is a schematic structural diagram of a first apparatus for sending data according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a second apparatus for sending data according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of an electronic device corresponding to fig. 1 or fig. 4 provided in an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the specification without making any creative effort belong to the protection scope of the specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a first process for sending data provided in an embodiment of this specification, which may specifically include the following steps:
s100: and receiving an acquisition request aiming at the target data subset sent by the terminal. The acquisition request includes: a full set identification of a full set of data to which the target subset of data belongs and a subset identification of the target subset of data.
In this specification, the target data subset may be a data set composed of data corresponding to the acquisition request. The data corpus may be a set of all data in the current application scenario, including the data corresponding to the acquisition request. The target data subset is a subset of the data corpus, and the subset identification of the target data subset is used for distinguishing data in the data corpus belonging to the target data subset from data in the data corpus belonging to other data subsets. For example, when the technical solution in this specification is applied to a user selecting a commodity through a terminal, the corpus identifier may be a commodity keyword (e.g., coffee) input into the terminal by the user, and the data corpus is a set of data corresponding to the commodity keyword in the data source; the subset identification may be a screening condition (e.g., page number 2) for data in the corpus of data, and the target subset of data is the set of data in the corpus of data corresponding to coffee corresponding to page 2.
Specifically, the operation of receiving the acquisition request may be performed by the server. The terminal may include, but is not limited to, a mobile phone, a tablet Computer, a Personal Computer (PC), a vehicle with a driving assistance function, an unmanned vehicle, an unmanned aerial vehicle, and the like.
S102: determining a placeholder corresponding to each data in the full set of data corresponding to the full set identification.
For each data in the data corpus, the data's corresponding placeholder can be used to characterize the source of the data. For example, the placeholder for the data may be an identification of the data source to which the data belongs (e.g., identification of a data source is S1). Each data corresponding to the data corpus can be distinguished at least by the source of the data.
S104: and sorting the placeholders corresponding to each datum according to a preset sorting rule.
The preset ordering rule determines the order of the placeholders in the data corpus.
Optionally, the preset sort rule may be configuration data that is pre-loaded in the server, and a controller of the server may design the preset sort rule by changing the configuration data.
S106: and dividing the sorted placeholders according to the sorted placeholders and a preset subset division rule so as to determine a data subset to which the data corresponding to each sorted placeholder belongs.
The preset subset partition rule may be used to determine the number of data included in the data subset, and further, the preset subset partition rule may be used to limit the number of placeholders corresponding to the data included in the data subset. For example, when the technical solution in this specification is applied to a user selecting a commodity through a terminal, a preset subset partitioning rule may be used to determine the number of commodities contained in each page displayed to the user.
In this step, the placeholders have a certain sequence in the sequence formed by sorting, and the data subsets determined for the placeholders also have a corresponding sequence on the basis. For example, when the technical solution in this specification is applied to a user selecting a commodity through a terminal, the sequence of each data subset may be embodied by page number ordering of each data subset in a page displayed to the user.
S108: and determining a placeholder corresponding to the data belonging to the target data subset corresponding to the subset identification as a designated placeholder.
For example, when the technical solution in this specification is applied to a user selecting a commodity through a terminal, the user sends an acquisition request through the terminal, a subset in the acquisition request is identified as page number 2, and the server locates, in each data set having a certain sequence, a target data subset corresponding to page number 2, and determines a placeholder in the target data subset as a designated placeholder.
S110: and acquiring data corresponding to the designated placeholder in the data corresponding to the full set identifier.
The designated placeholder at least includes the identifier of the data source to which the data corresponding to the designated placeholder belongs, and the server can acquire the data corresponding to the designated placeholder from the data source according to the identifier of the data source corresponding to the designated placeholder.
S112: and returning the target data subset corresponding to the acquired data to the terminal.
For example, when the technical solution in this specification is applied to a user selecting a commodity through a terminal, the target data subset returned to the terminal by the server is: the data set composed of the data corresponding to the keyword coffee is divided into data on page 2.
The method of transmitting data described in this specification will be described in detail below.
As shown in fig. 2, in this specification, a network architecture includes a terminal, a server, and a data source. The server is in communication connection with the terminal and the data source respectively, and then the server can acquire corresponding data from the data source according to the acquisition request of the terminal, process the acquired data to acquire a target data subset corresponding to the acquisition request, and then return the target data subset to the terminal.
The data corpus comprises at least part of data stored in a plurality of data sources. When the technical scheme in the specification is applied to a user selecting a commodity through a terminal, data of the same type are generally stored in the same data source, for example, commodity information is stored in one data source, and comments on the commodity are stored in another data source.
Specifically, determining the placeholder corresponding to each data in the full set of data corresponding to the full set identifier may include: and for each data source, determining the quantity of the data belonging to the data corpus contained in the data source, and generating the quantity of placeholders corresponding to the data source as placeholders corresponding to the data belonging to the data corpus contained in the data source.
When the technical scheme in the specification is applied to a user selecting a commodity through a terminal, the server determines the quantity of data corresponding to the commodity, which are stored in each data source, according to the acquisition request. For example, the data sources are S1, S2, S3, and S4, and the data sources S1 to S4 respectively include the following data corresponding to the commodity: 3. 1, 5 and 2. The number of placeholders determined by the server for the data corresponding to the item in the data sources S1-S4, respectively, is: 3, 1, 5 and 2. And recording the placeholders corresponding to the data source S1 as S1, the placeholders corresponding to the data source S2 as S2, the placeholders corresponding to the data source S3 as S3, and the placeholders corresponding to the data source S4 as S4.
Then, the server sorts the placeholders corresponding to the data sources according to a preset sorting rule. For example, the ordering rule is: placeholders corresponding to the data source S1 and placeholders corresponding to the data source S2 are arranged in a mixed manner, placeholders corresponding to the data source S3 are located behind placeholders corresponding to the data source S1 and the data source S2 in the sequence obtained by sorting, and placeholders corresponding to the data source S4 are located behind placeholders corresponding to the data source S3 in the sequence obtained by sorting. The sequence of placeholders obtained after sorting may be: pn ═ s1, s2, s1, s1, s3, s3, s3, s3, s3, s 4.
And dividing the sorted placeholders according to the sorted placeholders and a preset subset division rule, wherein the preset subset division rule can be configuration data loaded in the server when determining the data subset to which the data corresponding to each placeholder belongs. The preset subset partition rule may also be determined by the server from an acquisition request sent by the terminal. For example, if the preset subset partition rule is that the number of data included in each data subset is 5, the number of placeholders corresponding to each data subset is 5. After the sequence of the placeholders obtained in the foregoing is divided according to the subset division rule, the obtained data subsets correspond to placeholder subsequences of P1 ═ { s1, s2, s1, s1, s3} and P2 ═ s3, s3, s3, s3, s4 }. The order of P1 precedes P2.
Thereafter, when the designated placeholder corresponding to the acquisition request is determined, the subset identifier of the target data subset corresponding to the acquisition instruction is page 2, and the designated placeholder corresponding to the subset identifier is each placeholder in the 2 nd placeholder subsequence P2 in the divided placeholder subsequences.
When the target data source corresponding to the designated placeholder is determined, the target data source corresponding to the placeholder can be determined in each data source according to the information corresponding to the data source in the designated placeholder. For example, the target data sources corresponding to the designated placeholders of the formed placeholder subsequence P2 are data source S3 and data source S4. The ordering of the target data subsets in each data subset is the order of the placeholder subsequence P2 corresponding to the target data subset in each placeholder subsequence. In the illustrative scenario of the present specification, the order of the target data subsets in each data subset is 2.
After the target data source corresponding to the designated placeholder is determined, a first offset and a second offset corresponding to the designated placeholder can be determined according to the arrangement condition of the data in the target data source in the data full set. The first offset and the second offset are used for determining a target data subset corresponding to the designated placeholder in each data corresponding to the data corpus contained in the target data source.
Procedure for determining target data subsets As shown in FIG. 3, when determining the first offset (Start) corresponding to each designated placeholder, all numbers before the sorting are determinedThe amount of data contained in the data subset that belongs to the target data source corresponding to the designated placeholder is used as the first offset of the designated placeholder. The placeholder subsequence P2 is preceded by a placeholder subsequence P1. The placeholder subsequence P1 includes 1 placeholder corresponding to the data source S3 and no placeholder corresponding to the data source S4. Then for each of the placeholder subsequences P2, corresponding to a placeholder S3 of the data source S3, the placeholder corresponds to a first offset of 1, i.e. Start S31 is ═ 1; corresponding to the placeholder S4 of the data source S4, the placeholder corresponds to a first offset of 0, i.e., StartS4=0。
When a second offset (Count) corresponding to each designated placeholder is determined, determining an ordering of the designated placeholder in the placeholder subsequence as the second offset corresponding to the designated placeholder. The placeholder subsequence P2 includes 4 placeholders corresponding to the data source S3 and 1 placeholder corresponding to the data source S4. The second offset corresponding to each designated placeholder in the placeholder subsequence P2 is 1, 2, 3, 4, 1, i.e. CountS3,1=1、CountS3,2=2、CountS3,3=3、CountS3,4=4、 CountS4,1=1。
And then, the server sends the first offset and the second offset to the corresponding target data source and receives the data corresponding to the acquisition request fed back by the target data source according to the first offset and the second offset. The target data source determines data corresponding to the acquisition request according to the first offset and the second offset, and may be implemented by the second process of sending data provided in the embodiments of the present specification.
Fig. 4 is a second process for sending data provided in the embodiment of this specification, which may specifically include the following steps:
s400: and receiving a data request sent by a server, wherein the data request comprises a full set identifier of a full set of data, a first offset and a second offset.
In particular, receiving a data request may be performed by a target data source to which the data request corresponds.
S402: and determining the data which is stored in the target data source and belongs to the data corpus according to the corpus identification.
For example, when the technical solution in this specification is applied to a case where a user selects a commodity through a terminal, for each target data source, data corresponding to the commodity is determined in the target data source from the commodity corresponding to the corpus identity as data corresponding to the data corpus in the target data source.
S404: and sequencing the determined data according to a preset sequencing rule aiming at the target data source.
The preset sort rule for the target data source may be configuration data loaded in the target data source, and a controller of the server may design the preset sort rule by changing the configuration data. For example, the preset ordering rule for the target data source may be: and ordering the data belonging to the data corpus in the target data source by taking the sales volume priority as a target.
S406: and determining data corresponding to the data request in the sorted data according to the sorted data, the first offset and the second offset.
For example, when the technical solution in this specification is applied to a user selecting a commodity through a terminal, if one of the target data sources is the data source S4, the first offset corresponding to the data source S4 is 0, and the second offset is 1. Thus, the data source S4 determines, as the data corresponding to the data request, the data whose order is the first order from among the sorted data.
S408: and returning the determined data corresponding to the data request to the server.
And after receiving the data corresponding to the acquisition request fed back by the target data source, the server sorts the data according to a preset sorting rule. The server can adjust the order of the data sent by the data source to the same order of the designated placeholders corresponding to the data in the placeholder subsequence P2 according to the ordering of the data fed back by the target data source. And the data with the arrangement sequence matched with the preset ordering rule after the ordering is the target data subset corresponding to the acquisition request. When the technical scheme in the specification is applied to a user selecting a commodity through a terminal, a target data subset corresponding to an acquisition request is data belonging to page 2 in a data corpus requested by the user through the terminal.
Based on the same idea, the embodiments of the present specification further provide a corresponding apparatus for sending data as shown in fig. 5 and fig. 6.
Fig. 5 is a schematic structural diagram of a first apparatus for sending data according to an embodiment of the present disclosure, where the first apparatus includes:
an obtaining request receiving module 500, configured to receive an obtaining request for a target data subset sent by a terminal, where the obtaining request includes: a full set identifier of a full set of data to which the target subset of data belongs and a subset identifier of the target subset of data;
a placeholder determining module 502, configured to determine a placeholder corresponding to each data in the data corpus corresponding to the corpus identifier;
a placeholder sorting module 504, configured to sort placeholders corresponding to each piece of data according to a preset sorting rule;
a data subset determining module 506, configured to divide the sorted placeholders according to the sorted placeholders and a preset subset division rule, so as to determine a data subset to which data corresponding to each sorted placeholder belongs;
a designated placeholder determining module 502, configured to determine a placeholder corresponding to data belonging to the target data subset corresponding to the subset identifier as a designated placeholder;
a data obtaining module 510, configured to obtain, from the data corresponding to the full set identifier, data corresponding to the designated placeholder;
a sending module 512, configured to return the target data subset corresponding to the obtained data to the terminal.
The acquisition request receiving module 500, the placeholder determining module 502, the placeholder sorting module 504, the data subset determining module 506, the designated placeholder determining module 508, the data acquiring module 510 and the sending module 512 are electrically connected in sequence.
Optionally, the placeholder determining module 502 includes a number determining submodule 5020 and a placeholder generating submodule 5022. The number determination submodule 5020 is electrically connected with the placeholder generation submodule 5022.
The quantity determination submodule 5020 is used for determining the quantity of the data contained in each data source and belonging to the data complete set.
The placeholder generating submodule 5022 is configured to generate the number of placeholders corresponding to the data source as placeholders corresponding to the data included in the data source and belonging to the data corpus.
Optionally, the data obtaining module 510 includes a destination data source determining submodule 5100, a destination data subset ordering determining submodule 5102, a first offset determining submodule 5104, a second offset determining submodule 5106 and a data obtaining submodule 5108. The destination data subset order determining submodule 5102 is electrically connected to the destination data source determining submodule 5100, the first offset determining submodule 5104 and the second offset determining submodule 5106, and the data obtaining submodule 5108 is electrically connected to the first offset determining submodule 5104 and the second offset determining submodule 5106.
The target data source determining submodule 5100 is configured to determine, for each designated placeholder, a data source corresponding to the designated placeholder as a target data source;
a target data subset ranking determining submodule 5102, configured to determine rankings of the target data subsets in the data subsets;
a first offset determining submodule 5104, configured to determine, as a first offset, the number of data belonging to the target data source included in all data subsets before the sorting;
the second offset determining submodule 5106 is configured to determine a second offset according to the sorting of the data corresponding to the designated placeholder in all data belonging to the target data source included in the target data subset;
the data obtaining submodule 5108 is configured to send the first offset and the second offset to the target data source, so that the target data source determines and returns data corresponding to the designated placeholder according to the stored data belonging to the data corpus sorted by the target data source, the first offset and the second offset.
Optionally, the sending module 512 includes a target data subset determining sub-module and a sending sub-module. Wherein the target data subset determination submodule and the sending submodule are electrically connected.
The target data subset determining submodule is used for sequencing the acquired data corresponding to the designated placeholder according to the preset sequencing rule to obtain a target data subset consisting of the sequenced data;
and the sending submodule is used for returning the target data subset to the terminal.
Optionally, the apparatus is a server in communication connection with the terminal.
Fig. 6 is a schematic structural diagram of a second apparatus for sending data according to an embodiment of the present disclosure, where the second apparatus includes:
a data request receiving module 600, configured to receive a data request sent by a server, where the data request includes a corpus identifier of a corpus of data, a first offset, and a second offset;
a data screening module 602, configured to determine, according to the corpus identifier, data stored in the target data source and belonging to the corpus of data;
the data sorting module 604 is configured to sort the determined data according to a preset sorting rule for the target data source;
a data determining module 606, configured to determine, according to the sorted data, the first offset and the second offset, data corresponding to the data request in the sorted data;
a data returning module 608, configured to return the determined data corresponding to the data request to the server.
The data request receiving module 600, the data screening module 602, the data sorting module 604, the data determining module 606 and the data returning module 608 are electrically connected in sequence.
Optionally, the device is a target data source in communication connection with the server.
Embodiments of the present specification also provide a computer-readable storage medium, which stores a computer program, where the computer program can be used to execute the process of sending data provided in fig. 1 or fig. 4.
The embodiment of the present specification also proposes a schematic structural diagram of the electronic device shown in fig. 7. As shown in fig. 7, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the process of sending data described in fig. 1 or fig. 4. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method of transmitting data, the method comprising:
receiving an acquisition request aiming at a target data subset sent by a terminal, wherein the acquisition request comprises: a full set identifier of a full set of data to which the target subset of data belongs and a subset identifier of the target subset of data;
determining a placeholder corresponding to each data in the data full set corresponding to the full set identification;
sorting the placeholders corresponding to each datum according to a preset sorting rule;
dividing the sorted placeholders according to the sorted placeholders and a preset subset division rule to determine a data subset to which data corresponding to each sorted placeholder belongs;
determining a placeholder corresponding to the data belonging to the target data subset corresponding to the subset identification as a designated placeholder;
acquiring data corresponding to the designated placeholder in the data corresponding to the full set identifier;
and returning the target data subset corresponding to the acquired data to the terminal.
2. The method of claim 1, wherein the corpus of data includes data stored in a number of data sources;
determining a placeholder corresponding to each data in the data corpus corresponding to the corpus identifier specifically includes:
for each data source, determining the quantity of data belonging to the data corpus contained in the data source;
generating the number of placeholders corresponding to the data source as placeholders corresponding to data contained in the data source that belongs to the data corpus.
3. The method according to claim 2, wherein obtaining the data corresponding to the designated placeholder from the data corresponding to the corpus identity specifically comprises:
for each designated placeholder, determining a data source corresponding to the designated placeholder as a target data source;
determining the ordering of the target data subsets in each data subset;
determining the quantity of data belonging to the target data source contained in all data subsets before the sorting as a first offset;
determining a second offset according to the sequence of the data corresponding to the designated placeholder in all data belonging to the target data source contained in the target data subset;
and sending the first offset and the second offset to the target data source, so that the target data source determines the data corresponding to the designated placeholder according to the stored data belonging to the data corpus sorted by the target data source, the first offset and the second offset, and returning.
4. The method of claim 1, wherein returning the target data subset corresponding to the obtained data to the terminal specifically includes:
according to the preset sorting rule, sorting the acquired data corresponding to the designated placeholder to obtain a target data subset consisting of the sorted data;
and returning the target data subset to the terminal.
5. The method of claim 1, wherein the target subset of data is a page;
the subset identification is a page number corresponding to the page.
6. A method of transmitting data, the method comprising:
a target data source receives a data request sent by a server, wherein the data request comprises a full set identifier of a full set of data, a first offset and a second offset; the first offset is obtained according to the number of data belonging to the target data source in all the data subsets including the target data subset and the predetermined sequence of the target data subset in each data subset; the second offset is obtained according to the ordering of the data corresponding to the designated placeholder in all data belonging to the target data source contained in the target data subset; the designated placeholder is a placeholder corresponding to data of the target subset of data;
determining data which is stored in the target data source and belongs to the data corpus according to the corpus identification;
sequencing the determined data according to a preset sequencing rule aiming at the target data source;
determining data corresponding to the data request in the sorted data according to the sorted data, the first offset and the second offset;
and returning the determined data corresponding to the data request to the server.
7. An apparatus for transmitting data, comprising:
an obtaining request receiving module, configured to receive an obtaining request for a target data subset sent by a terminal, where the obtaining request includes: a full set identifier of a full set of data to which the target subset of data belongs and a subset identifier of the target subset of data;
a placeholder determining module, configured to determine a placeholder corresponding to each data in the data corpus corresponding to the corpus identifier;
the placeholder sorting module is used for sorting the placeholders corresponding to each piece of data according to a preset sorting rule;
the data subset determining module is used for dividing the sorted placeholders according to the sorted placeholders and a preset subset dividing rule so as to determine a data subset to which the data corresponding to each sorted placeholder belongs;
a designated placeholder determining module, configured to determine a placeholder corresponding to data belonging to the target data subset corresponding to the subset identifier, as a designated placeholder;
the data acquisition module is used for acquiring data corresponding to the designated placeholder from the data corresponding to the full set identifier;
and the sending module is used for returning the target data subset corresponding to the acquired data to the terminal.
8. An apparatus for transmitting data, comprising:
the data request receiving module is used for receiving a data request sent by a server, wherein the data request comprises a full set identifier of a full set of data, a first offset and a second offset; the first offset is obtained according to the number of data belonging to the target data source in all the data subsets including the target data subset and the predetermined sequence of the target data subset in each data subset; the second offset is obtained according to the ordering of the data corresponding to the designated placeholder in all data belonging to the target data source contained in the target data subset; the designated placeholder is a placeholder corresponding to data of the target subset of data;
the data screening module is used for determining data which are stored in the target data source and belong to the data corpus according to the corpus identification;
the data sorting module is used for sorting the determined data according to a preset sorting rule aiming at the target data source;
a data determining module, configured to determine, according to the sorted data, the first offset and the second offset, data corresponding to the data request in the sorted data;
and the data returning module is used for returning the determined data corresponding to the data request to the server.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-5 or the method of claim 6.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-5 or the method of claim 6 when executing the program.
CN201910892672.0A 2019-09-20 2019-09-20 Method and device for sending data Active CN110704733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910892672.0A CN110704733B (en) 2019-09-20 2019-09-20 Method and device for sending data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910892672.0A CN110704733B (en) 2019-09-20 2019-09-20 Method and device for sending data

Publications (2)

Publication Number Publication Date
CN110704733A CN110704733A (en) 2020-01-17
CN110704733B true CN110704733B (en) 2020-10-02

Family

ID=69195458

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910892672.0A Active CN110704733B (en) 2019-09-20 2019-09-20 Method and device for sending data

Country Status (1)

Country Link
CN (1) CN110704733B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268295A (en) * 2014-10-24 2015-01-07 迈普通信技术股份有限公司 Data query method and device
CN107105021A (en) * 2017-04-06 2017-08-29 南京三宝弘正视觉科技有限公司 A kind of data read-write method and device
CN110162570A (en) * 2019-04-17 2019-08-23 阿里巴巴集团控股有限公司 The gradation acquisition methods and device of block chain data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10938682B2 (en) * 2014-12-30 2021-03-02 Research Electronics International, Llc System and method for detecting constant-datagram-rate network traffic

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104268295A (en) * 2014-10-24 2015-01-07 迈普通信技术股份有限公司 Data query method and device
CN107105021A (en) * 2017-04-06 2017-08-29 南京三宝弘正视觉科技有限公司 A kind of data read-write method and device
CN110162570A (en) * 2019-04-17 2019-08-23 阿里巴巴集团控股有限公司 The gradation acquisition methods and device of block chain data

Also Published As

Publication number Publication date
CN110704733A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN107450979B (en) Block chain consensus method and device
CN107450981B (en) Block chain consensus method and equipment
CN108848244B (en) Page display method and device
CN109104327B (en) Service log generation method, device and equipment
CN110674408A (en) Service platform, and real-time generation method and device of training sample
CN110717536A (en) Method and device for generating training sample
RU2605041C2 (en) Methods and systems for displaying microblog topics
CN111767499A (en) Page configuration method and device
CN112597013A (en) Online development and debugging method and device
CN109597678B (en) Task processing method and device
CN111784468B (en) Account association method and device and electronic equipment
CN110781386A (en) Information recommendation method and device, and bloom filter creation method and device
CN111881393A (en) Page rendering method, device, medium and electronic equipment
CN107784090B (en) File sharing method and device and computer readable medium
CN115617799A (en) Data storage method, device, equipment and storage medium
CN111241040B (en) Information acquisition method and device, electronic equipment and computer storage medium
CN107451204B (en) Data query method, device and equipment
CN107479868B (en) Interface loading method, device and equipment
CN110602163B (en) File uploading method and device
CN113079201B (en) Information processing system, method, device and equipment
CN108446301B (en) Business file splitting and summarizing method, device and equipment
CN111694992A (en) Data processing method and device
CN110083602B (en) Method and device for data storage and data processing based on hive table
CN110704733B (en) Method and device for sending data
CN110874322A (en) Test method and test server for application program

Legal Events

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