CN113779080B - Method and device for transmitting data - Google Patents

Method and device for transmitting data Download PDF

Info

Publication number
CN113779080B
CN113779080B CN202011345780.5A CN202011345780A CN113779080B CN 113779080 B CN113779080 B CN 113779080B CN 202011345780 A CN202011345780 A CN 202011345780A CN 113779080 B CN113779080 B CN 113779080B
Authority
CN
China
Prior art keywords
data
sequence number
cache queue
data sequence
stored
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
CN202011345780.5A
Other languages
Chinese (zh)
Other versions
CN113779080A (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 Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202011345780.5A priority Critical patent/CN113779080B/en
Publication of CN113779080A publication Critical patent/CN113779080A/en
Application granted granted Critical
Publication of CN113779080B publication Critical patent/CN113779080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/2455Query execution
    • G06F16/24552Database cache management
    • 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/23Updating
    • 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/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • 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/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for transmitting data, and relates to the technical field of computers. The method comprises the following steps: reading data in a cache queue in response to receiving a data acquisition request, wherein the data acquisition request comprises a data identifier; and in response to determining that the target data corresponding to the data identifier exists in the cache queue, after storing the target data in the local disk, sending the target data to a data requester sending a data acquisition request. By adopting the method, the efficiency and the accuracy of data transmission can be improved.

Description

Method and device for transmitting data
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to a method and apparatus for transmitting data.
Background
Data interaction between servers, databases in servers, or between servers and terminals is an important cornerstone for implementing functions of servers as well as terminals. The existing method for sending data by the server is to call and send the data from a disk or cache data.
However, the existing method of transmitting data has a problem of inefficiency or inaccuracy.
Disclosure of Invention
The present disclosure provides a method, apparatus, electronic device, and computer-readable storage medium for transmitting data.
According to a first aspect of the present disclosure, there is provided a method for transmitting data, comprising: reading data in a cache queue in response to receiving a data acquisition request, wherein the data acquisition request comprises a data identifier; and in response to determining that the target data corresponding to the data identifier exists in the cache queue, after storing the target data in the local disk, sending the target data to a data requester sending a data acquisition request.
In some embodiments, the method for transmitting data further comprises: reading target data from a local disk in response to determining that the target data does not exist in the cache queue, wherein the local disk is used for storing the data in the cache queue; the target data is sent to the data requestor.
In some embodiments, the data identification includes a data sequence number of the data, and the method for transmitting the data includes: the stored data sequence number is determined to be the data sequence number of the target data, and the stored data sequence number is used for indicating the data sequence number of the data stored in the local disk in the cache queue.
In some embodiments, a method for transmitting data includes: in response to determining that the maximum data sequence number of each stored data sequence number is greater than the minimum data sequence number of the data in the local storage, obtaining data corresponding to a missing data sequence number from the cache queue, wherein the data sequence number is incremented with the increase of the data, and the missing data sequence number comprises a data sequence number between the minimum data sequence number of the data in the local storage and the maximum data sequence number of each stored data sequence number; and storing the data corresponding to the missing data serial numbers into a local storage.
In some embodiments, the data includes a system log file for recording operations performed by the system, and the data identification includes a log sequence number of the system log file.
According to a second aspect of the present disclosure, there is provided an apparatus for transmitting data, comprising: a receiving unit configured to read data in the cache queue in response to receiving a data acquisition request, wherein the data acquisition request includes a data identifier; and the first sending unit is configured to send the target data to a data requester sending the data acquisition request after storing the target data in the local disk in response to determining that the target data corresponding to the data identifier exists in the cache queue.
In some embodiments, the means for transmitting data further comprises: an obtaining unit configured to read target data from a local disk in response to determining that the target data does not exist in the cache queue, wherein the local disk is used for storing the data in the cache queue; and a second transmitting unit configured to transmit the target data to the data requester.
In some embodiments, the data identifier comprises a data sequence number of the data, and the means for transmitting the data comprises: and an updating unit configured to determine a stored data sequence number indicating a data sequence number of the data stored in the local disk in the cache queue as a data sequence number of the target data.
In some embodiments, an apparatus for transmitting data includes: a calibration unit configured to acquire data corresponding to a missing data sequence number from the cache queue in response to determining a maximum data sequence number among the respective stored data sequence numbers that is greater than a minimum data sequence number of the data in the local storage, wherein the data sequence number is incremented with an increase in data, the missing data sequence number including a data sequence number between the minimum data sequence number of the data in the local storage and the maximum data sequence number among the respective stored data sequence numbers; and a storage unit configured to store data corresponding to the missing data sequence number in a local storage.
In some embodiments, the data includes a system log file for recording operations performed by the system, and the data identification includes a log sequence number of the system log file.
According to a third aspect of the present disclosure, embodiments of the present disclosure provide an electronic device comprising: one or more processors to: and storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for transmitting data as provided in the first aspect.
According to a fourth aspect of the present disclosure, embodiments of the present disclosure provide a computer-readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements the method for transmitting data provided by the first aspect.
According to the method and the device for sending data, after the data acquisition request is received, the cache queue is read, if the target data corresponding to the data identification in the data acquisition request exists in the cache queue, after the target data is stored in the local disk, the target data is sent to a data request party sending the data acquisition request, the data can be firstly obtained from the cache queue storing the current data, and the data is determined to be the target data to be sent after the data is stored in the local disk, so that the situation that the data to be sent is not the final data due to data updating operations such as cache data loss or change caused by equipment power failure and the like is avoided, the efficiency and the accuracy of obtaining the target data can be improved, and the efficiency and the accuracy of sending the data are further improved.
The technology solves the problems of low efficiency or inaccuracy of the existing data transmission method.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method for transmitting data in accordance with the present application;
FIG. 3 is a flow chart of another embodiment of a method for transmitting data according to the present application;
FIG. 4 is a schematic diagram of an embodiment of an apparatus for transmitting data in accordance with the present application;
Fig. 5 is a block diagram of an electronic device for implementing a method for transmitting data according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 shows an exemplary system architecture 100 to which an embodiment of a method for transmitting data or an apparatus for transmitting data of the present application may be applied.
As shown in fig. 1, system architecture 100 may include a server 101, a network 102, and a server 103. Network 102 is the medium used to provide communication links between servers 101 and 103. Network 102 may include various connection types such as wired, wireless communication links, or fiber optic cables, among others.
Server 101 interacts with server 103 over network 102 to receive or transmit system data, log files, and the like. The server 101 may be the primary storage space for data processing, e.g., the master node in the sql (Structured Query Language ) database. The server 103 may be a slave storage space for backing up the server 101, e.g. a slave node in an sql database. It is understood that at this point server 101 and server 103 may refer to different storage spaces deployed in the same server.
After the server 101 receives the data acquisition request sent by the server 103, reading a cache queue of the server 101, wherein the data acquisition request comprises a data identifier; if it is determined that the target data corresponding to the data identifier exists in the cache queue of the server 101, the target data is stored in the disk space of the server 101, and then the target data is transmitted to the server 103.
It should be noted that, the method for transmitting data provided by the embodiment of the present disclosure is generally performed by the server 101, and accordingly, the apparatus for transmitting data is generally provided in the server 101.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for transmitting data according to the present disclosure is shown, comprising the steps of:
In step 201, in response to receiving a data acquisition request, data in a cache queue is read, wherein the data acquisition request includes a data identifier.
In the present embodiment, when the execution subject of the method for transmitting data (e.g., the server 101 shown in fig. 1) receives a data acquisition request, the data in the cache queue is read. The data acquisition request includes a data identifier of the required data, and the identification information may be identification information such as a type of the data, a name of a file, a storage address of the data, or a storage serial number of the data.
In this embodiment, the buffer queue is a storage space for temporarily storing received or generated data, and in general, the buffer queue stores data in a current period, that is, the data is circularly overwritten into the storage space at a fixed time interval, and when the device is powered down, the data in the buffer queue is lost.
Step 202, in response to determining that the target data corresponding to the data identifier exists in the cache queue, after storing the target data in the local disk, sending the target data to a data requester that sends a data acquisition request.
In this embodiment, if it is determined that the target data corresponding to the data identifier exists in the cache queue, after the target data is stored in the local disk, the target data is sent to the data requester that sends the data acquisition request.
In this embodiment, the execution body may be a storage space for providing services such as data calculation/data processing/data transmission, and the data requester may be a storage space for backing up data stored in the execution body, or the data requester may be a terminal device that requests acquisition of data.
According to the method for sending data, after the data acquisition request is received, the cache queue is read, if it is determined that target data corresponding to the data identifier in the data acquisition request exists in the cache queue, after the target data is stored in the local disk, the target data is sent to a data requester sending the data acquisition request, the data can be firstly obtained from the cache queue storing the current data, and the data is determined to be the target data to be sent after the data is stored in the local disk, so that the situation that the data to be sent is not the final data due to data updating operations such as cache data loss or change caused by equipment power failure is avoided, the efficiency and the accuracy of obtaining the target data can be improved, and the efficiency and the accuracy of sending the data are further improved.
Optionally, the method for transmitting data further comprises: reading target data from a local disk in response to determining that the target data does not exist in the cache queue, wherein the local disk is used for storing the data in the cache queue; the target data is sent to the data requestor.
In this embodiment, if it is determined that the target data corresponding to the data identifier does not exist in the cache queue, the target data is read from the local disk, and the target data read from the local disk is sent to the data requester. The local disk is used for storing data in the data cache queue, that is, the data generated or received by the server is temporarily stored in the cache space/memory space/cache queue first, and the data in the cache space/memory space/cache queue is circularly covered, so that the data generated or received by the server is permanently stored for later use, and the local disk continuously and permanently stores the data in the cache space/memory space/cache queue on the local disk. It should be noted that persistent storage refers to persistent storage over a period of time, which is a disk space that can store data permanently without actively deleting the data, with respect to a cache queue or a memory cache space.
In this embodiment, when there is no target data corresponding to the data identifier in the cache queue, it is indicated that the target data has been covered by new data written into the cache queue in a circulating manner, and since the local disk stores the data written into the cache queue in each circulating manner, the target data can be obtained from the local disk, thereby increasing the way of obtaining the data and improving the success rate of obtaining the data.
With continued reference to fig. 3, a flow 300 of another embodiment of a method for transmitting data according to the present disclosure is shown, comprising the steps of:
in step 301, in response to receiving a data acquisition request, data in a cache queue is read, wherein the data acquisition request includes a data sequence number of the data.
In the present embodiment, when the execution subject of the method for transmitting data (e.g., the server 101 shown in fig. 1) receives a data acquisition request, the data in the cache queue is read. The data acquisition request includes a data sequence number of the required data.
In step 302, in response to determining that the target data corresponding to the data sequence number exists in the cache queue, the target data is sent to a data requester that sends a data acquisition request after the target data is stored in the local disk.
In this embodiment, if it is determined that the target data corresponding to the data sequence number exists in the cache queue, the target data is sent to the data requester that sends the data acquisition request after the target data is stored in the local disk.
Step 303, determining the stored data sequence number as the data sequence number of the target data, where the stored data sequence number is used to indicate the data sequence number of the data stored in the local disk in the cache queue.
In the present embodiment, the data sequence number of the target data is determined as the stored data sequence number, that is, the data sequence number for indicating the data in the cache queue that has been stored in the local disk. In general, data in the cache queue is sequentially and continuously stored in the local disk, and at this time, the data sequence number of the data in the cache queue that is most recent/latest/last stored in the local disk is recorded by using the stored data sequence number, so that the position/sequence number of the data in the cache queue that is already written in the local disk can be recorded, so as to record which data in the cache queue is the data that is already stored in the local disk and which data that is not yet stored in the local disk.
In this embodiment, the use of the data serial number as the data identifier may facilitate management of each piece of data, and after the data in the cache queue is stored in the local disk, updating the serial number of the stored data to the serial number of the data stored in the local disk may facilitate recording the number/position of the data in the cache queue that has not been stored or has been stored in the local disk, thereby facilitating maintenance of the storage operation of the data from the cache queue to the local disk.
Optionally, in response to determining that the maximum data sequence number of the respective stored data sequence numbers is greater than the minimum data sequence number of the data in the local store, obtaining data corresponding to the missing data sequence number from the cache queue, wherein the data sequence number is incremented with increasing data, the missing data sequence number comprising a data sequence number between the minimum data sequence number of the data in the local store and the maximum data sequence number of the respective stored data sequence numbers; and storing the data corresponding to the missing data serial numbers into a local storage.
In this embodiment, after the storage module or the server is restarted, the integrity of the data stored in the local disk, the consistency of the data stored in the local disk and the cache queue, or the synchronization of the data stored in the local disk and the cache queue may be checked at regular time.
Specifically, in the case where the sequence numbers of the data are sequentially increased, that is, in the case where the sequence numbers of the data that identify the data are increased with the continuous generation of new data/the increase of the data one by one, if it is determined that the largest data sequence number among the respective stored sequence numbers is larger than the smallest data sequence number among the data sequence numbers of the data in the local storage, it may be determined that there is data that is not stored in the local disk in the cache queue, and the data that is not stored in the local disk is the data identified by the data sequence numbers between the smallest data sequence number and the largest data sequence number. The data identified by the data sequence numbers between the smallest data sequence number and the largest data sequence number can be stored in the local disk to ensure the integrity of the data in the local disk.
Specifically, in the case where the sequence numbers of the data are sequentially decreasing, if it is determined that the smallest data sequence number among the stored sequence numbers is smaller than the largest data sequence number among the data sequence numbers of the data in the local storage, it may be determined that there is data that is not stored in the local disk yet in the cache queue, and the data that is not stored in the local disk is the data identified by the data sequence numbers between the largest data sequence number and the smallest data sequence number.
In this embodiment, the integrity of the data stored in the local disk, or the consistency of the data stored in the local disk and the cache queue, or the synchronism of the data stored in the local disk and the cache queue is checked, and the missing data is synchronized when the data stored in the local disk and the data stored in the cache queue are inconsistent, so that the integrity of the data stored in the local disk, the consistency of the data stored in the cache queue, and the synchronism of the data stored in the local disk can be ensured, and the accuracy of the data stored in the local disk is ensured.
In some alternative implementations of the embodiments described above in connection with fig. 2 and 3, the data includes a system log file, and the data identification includes a log sequence number of the system log file, where the system log file is used to record operations performed by the system.
In this embodiment, the data may be a log file for recording operations completed by the system, for example, a log file of modification operations, update operations, system configuration operations, database write operations, and the like. The data identification may be a log sequence number (log sequence number, lsn) of the system log file or the like for identifying the number of the log file.
In some application scenarios, the sql (Structured Query Language ) database is a database architecture of a master node corresponding to at least one slave node, and when the master node receives an acquisition request sent by the slave node to acquire a log file, such as a redo log (redolog), the master node can read data in a cache queue according to a log serial number in the acquisition request. If the master node determines that the target log file corresponding to the log serial number exists in the cache queue, the target log file is written into the local disk from the cache queue, and then the target log file is sent to the slave node requesting to acquire the log file.
If the master node determines that the target log file corresponding to the log serial number does not exist in the cache queue, the master node acquires the target log file from the local disk and sends the target log file to the slave node requesting to acquire the log file.
The local disk and the cache queue are both storage spaces for storing log files. The buffer memory pair is listed as a storage space for receiving data in real time, and old data is covered after new data is flushed into the buffer memory queue, so that after the data is flushed into the buffer memory queue, the local disk acquires the data from the buffer memory queue and stores the data in the local disk in a lasting manner, and after the local disk finishes storing the data flushed into the buffer memory queue in the current cycle, the buffer memory queue can be instructed to flush the new data so as to ensure the integrity and accuracy of the data in the local disk.
With further reference to fig. 4, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of an apparatus for transmitting data, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2 or fig. 3, and the apparatus is particularly applicable to various electronic devices.
As shown in fig. 4, the apparatus 400 for transmitting data of the present embodiment includes: a receiving unit 401, a first transmitting unit 402. Wherein the receiving unit 401 is configured to read the data in the cache queue in response to receiving a data acquisition request, wherein the data acquisition request includes a data identifier; the first sending unit 402 is configured to send, in response to determining that the target data corresponding to the data identifier exists in the cache queue, the target data to a data requester that sends the data acquisition request after storing the target data in the local disk.
In some embodiments, the means for transmitting data further comprises: an obtaining unit configured to read target data from a local disk in response to determining that the target data does not exist in the cache queue, wherein the local disk is used for storing the data in the cache queue; and a second transmitting unit configured to transmit the target data to the data requester.
In some embodiments, the data identifier comprises a data sequence number of the data, and the means for transmitting the data comprises: and an updating unit configured to determine a stored data sequence number indicating a data sequence number of the data stored in the local disk in the cache queue as a data sequence number of the target data.
In some embodiments, an apparatus for transmitting data includes: a calibration unit configured to acquire data corresponding to a missing data sequence number from the cache queue in response to determining a maximum data sequence number among the respective stored data sequence numbers that is greater than a minimum data sequence number of the data in the local storage, wherein the data sequence number is incremented with an increase in data, the missing data sequence number including a data sequence number between the minimum data sequence number of the data in the local storage and the maximum data sequence number among the respective stored data sequence numbers; and a storage unit configured to store data corresponding to the missing data sequence number in a local storage.
In some embodiments, the data comprises a system log file, and the data identification comprises a log sequence number of the system log file, wherein the system log file is used to record operations performed by the system. The units in the above-described apparatus 400 correspond to the steps in the method described with reference to fig. 2 or 3. The operations, features and technical effects achieved thereby described above with respect to the method for transmitting data are equally applicable to the apparatus 400 and the units contained therein, and are not described in detail herein.
According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
As shown in fig. 5, there is a block diagram of an electronic device 500 for a method of extracting video clips according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 5, the electronic device includes: one or more processors 501, memory 502, and interfaces for connecting components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 501 is illustrated in fig. 5.
Memory 502 is a non-transitory computer readable storage medium provided by the present application. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method for extracting video clips provided by the present application. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to execute the method for extracting video clips provided by the present application.
The memory 502 is used as a non-transitory computer readable storage medium for storing a non-transitory software program, a non-transitory computer executable program, and modules, such as program instructions/modules (e.g., the receiving unit 401, the first transmitting unit 402 shown in fig. 4) corresponding to the method for extracting video clips in the embodiment of the present application. The processor 501 executes various functional applications of the server and data processing, i.e., implements the method for extracting video clips in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 502.
Memory 502 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the electronic device for extracting video clips, and the like. In addition, memory 502 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 502 optionally includes memory remotely located with respect to processor 501, which may be connected to the electronic device for extracting video clips 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 electronic device for the method of extracting video clips may further include: input means 503, output means 504 and bus 505. The processor 501, memory 502, input devices 503 and output devices 504 may be connected by a bus 505 or otherwise, in fig. 5 by way of example by bus 505.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic device used to extract the video clip, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, and the like. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.

Claims (10)

1. A method for transmitting data, comprising:
reading data in a cache queue in response to receiving a data acquisition request, wherein the data acquisition request comprises a data identifier;
in response to determining that target data corresponding to the data identifier exists in the cache queue, after the target data is stored in a local disk, sending the target data to a data requester for sending the data acquisition request;
In response to determining that a maximum data sequence number of each stored data sequence number is greater than a minimum data sequence number of data in the local storage, obtaining data corresponding to a missing data sequence number from the cache queue, wherein the stored data sequence number is used for indicating the data sequence number of the data in the cache queue which is stored in the local disk, the data sequence number increases with the increase of the data, and the missing data sequence number comprises a data sequence number between the minimum data sequence number of the data in the local storage and the maximum data sequence number of each stored data sequence number;
and storing the data corresponding to the missing data serial numbers into a local storage.
2. The method of claim 1, wherein the method further comprises:
Reading the target data from the local disk in response to determining that the target data does not exist in the cache queue, wherein the local disk is used for storing the data in the cache queue;
And sending the target data to the data requester.
3. The method of claim 1, wherein the data identification comprises a data sequence number of the data, the method comprising:
And determining the stored data sequence number as the data sequence number of the target data.
4. A method according to any of claims 1-3, wherein the data comprises a system log file for recording operations performed by the system, the data identification comprising a log sequence number of the system log file.
5. An apparatus for transmitting data, comprising:
A receiving unit configured to read data in a cache queue in response to receiving a data acquisition request, wherein the data acquisition request includes a data identifier;
A first sending unit configured to send, in response to determining that target data corresponding to the data identifier exists in the cache queue, the target data to a data requester that sends the data acquisition request after storing the target data in a local disk;
a calibration unit configured to obtain data corresponding to a missing data sequence number from the cache queue in response to determining a maximum data sequence number of each stored data sequence number, which is greater than a minimum data sequence number of the data in the local storage, wherein the stored data sequence number is used for indicating a data sequence number of the data in the cache queue which has been stored in the local disk, the data sequence number increases with the increase of the data, and the missing data sequence number comprises a data sequence number between the minimum data sequence number of the data in the local storage and the maximum data sequence number of each stored data sequence number;
and the storage unit is configured to store the data corresponding to the missing data serial number into a local storage.
6. The apparatus of claim 5, wherein the apparatus further comprises:
An obtaining unit configured to read the target data from the local disk in response to determining that the target data does not exist in the cache queue, wherein the local disk is used for storing the data in the cache queue;
and a second transmitting unit configured to transmit the target data to the data requester.
7. The apparatus of claim 5, wherein the data identification comprises a data sequence number of the data, the apparatus comprising:
and the updating unit is configured to determine that the stored data sequence number is the data sequence number of the target data.
8. The apparatus of one of claims 5-7, wherein the data comprises a system log file for recording operations completed by a system, the data identification comprising a log sequence number of the system log file.
9. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
CN202011345780.5A 2020-11-26 2020-11-26 Method and device for transmitting data Active CN113779080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011345780.5A CN113779080B (en) 2020-11-26 2020-11-26 Method and device for transmitting data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011345780.5A CN113779080B (en) 2020-11-26 2020-11-26 Method and device for transmitting data

Publications (2)

Publication Number Publication Date
CN113779080A CN113779080A (en) 2021-12-10
CN113779080B true CN113779080B (en) 2024-06-18

Family

ID=78835254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011345780.5A Active CN113779080B (en) 2020-11-26 2020-11-26 Method and device for transmitting data

Country Status (1)

Country Link
CN (1) CN113779080B (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9342388B1 (en) * 2015-12-02 2016-05-17 International Business Machines Corporation Dynamic queue alias
CN111367687A (en) * 2020-02-28 2020-07-03 罗普特科技集团股份有限公司 Inter-process data communication method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Coverage Hole Detection Algorithm Based on HPNs in WSN;Han Yu Lao;IEEE;20190103;全文 *
基于超元数据缓存的高速数据访问系统;张震伟;马雁云;;广东通信技术;20160915(第09期);全文 *

Also Published As

Publication number Publication date
CN113779080A (en) 2021-12-10

Similar Documents

Publication Publication Date Title
CN111045985B (en) File storage processing method, server, electronic device and storage medium
CN112000394B (en) Method, apparatus, device and storage medium for accessing applet
CN111241108B (en) Key value based indexing method and device for KV system, electronic equipment and medium
US20210216212A1 (en) Method and apparatus for processing data
CN113364877B (en) Data processing method, device, electronic equipment and medium
US20210311770A1 (en) Method for implementing smart contract based on blockchain
EP3869339B1 (en) Data storage method and apparatus for blockchain, device, and medium
JP7397928B2 (en) Global secondary index method and device for distributed database
CN109086382A (en) A kind of method of data synchronization, device, equipment and storage medium
CN104881454A (en) Updating method and system of parameter
CN114816393A (en) Information generation method, device, equipment and storage medium
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
CN112579897B (en) Information searching method and device
CN111767169B (en) Data processing method, device, electronic equipment and storage medium
US20230033754A1 (en) Data processing method for distributed storage system, apparatus, and electronic device
CN111290714B (en) Data reading method and device
CN113779080B (en) Method and device for transmitting data
CN111597403A (en) Method and device for constructing graph index, electronic equipment and storage medium
CN114500443B (en) Message pushing method, device, system, electronic equipment and storage medium
US9588998B2 (en) Protecting storage data during system migration
CN115640280A (en) Data migration method and device
CN111639116B (en) Data access connection session protection method and device
CN112306413B (en) Method, device, equipment and storage medium for accessing memory
CN111581049A (en) Method, device, equipment and storage medium for monitoring running state of distributed system
CN111930748B (en) Method, device, equipment and storage medium for tracking data of streaming computing system

Legal Events

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