CN113760927A - Data processing method and device, electronic equipment and computer readable medium - Google Patents

Data processing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113760927A
CN113760927A CN202110110875.7A CN202110110875A CN113760927A CN 113760927 A CN113760927 A CN 113760927A CN 202110110875 A CN202110110875 A CN 202110110875A CN 113760927 A CN113760927 A CN 113760927A
Authority
CN
China
Prior art keywords
information
client request
storage
lock
client
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.)
Pending
Application number
CN202110110875.7A
Other languages
Chinese (zh)
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 CN202110110875.7A priority Critical patent/CN113760927A/en
Publication of CN113760927A publication Critical patent/CN113760927A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2315Optimistic concurrency control
    • G06F16/2322Optimistic concurrency control using timestamps
    • 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/242Query formulation
    • G06F16/2433Query languages
    • 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

Abstract

The embodiment of the disclosure discloses a data processing method, a data processing device, an electronic device and a computer readable medium. One embodiment of the method comprises: in response to receiving client request information sent by a target client, determining a target storage node corresponding to the client request information from a distributed storage node set; determining whether initial storage information in a target storage node corresponding to the client request information is in a locked state; updating the initial storage information based on the client request information to generate updated storage information in response to the initial storage information not being in a locked state; and distributing the updated storage information to each distributed storage node in parallel. This embodiment improves the efficiency of data writing.

Description

Data processing method and device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer-readable medium.
Background
At present, activities in industries such as e-commerce, finance, retail and the like are increasingly frequent, so that related data of each industry are rapidly increased, the bearing capacity of a single database gradually reaches the limit, and the development of related industries is further restricted. At present, when mass data is processed, a distributed database is mostly adopted for data processing.
However, when the data processing operation is performed in the above manner, there are often the following technical problems:
the existing distributed system only has one storage node for providing writing service, and when the existing distributed system faces massive request information, the efficiency of data writing is low.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Some embodiments of the present disclosure propose data processing methods, apparatuses, electronic devices and computer readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a data processing method, including: in response to receiving client request information sent by a target client, determining a target storage node corresponding to the client request information from a distributed storage node set; determining whether initial storage information in the target storage node corresponding to the client request information is in a locked state; in response to the initial storage information not being in a locked state, updating the initial storage information based on the client request information to generate updated storage information; and distributing the updated storage information to each distributed storage node in parallel.
Optionally, the client request information includes: the client requests information identification information, and before the updating the initial storage information based on the client request information to generate updated storage information, the method further comprises: and generating lock information according to the client request information identification information and the timestamp corresponding to the current time.
Optionally, updating the initial storage information based on the client request information includes: and updating the initial storage information based on the client request information in response to the generation of the lock information to generate updated storage information.
Optionally, the client request information further includes: the client requests data; and the method further comprises: in response to determining that the initial storage information is in a locked state, determining whether first identification information and second identification information are matched, wherein the first identification information is lock identification information included in lock information corresponding to the initial storage information, and the second identification information is client request information identification information; and updating the time stamp included in the lock information corresponding to the initial storage information to the time stamp corresponding to the current time in response to determining that the first identification information and the second identification information are matched.
Optionally, the method further comprises: in response to determining that the first identification information and the second identification information are not matched, determining a difference value between a timestamp included in the lock information corresponding to the initial storage information and a timestamp corresponding to the current time to generate a lock-in duration; and in response to the fact that the lock existence time length is determined to be greater than or equal to the preset time length, updating the first identification information to target identification information, and updating a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
Optionally, updating the initial storage information based on the client request information to generate updated storage information, including: and updating data included in the initial storage information based on the client request data to generate updated storage information.
Optionally, the method further comprises: and sending the updated storage information to the target client for display.
In a second aspect, some embodiments of the present disclosure provide a data processing apparatus comprising: the first determining unit is configured to respond to the receiving of client request information sent by a target client, and determine a target storage node corresponding to the client request information from a distributed storage node set; a second determining unit configured to determine whether initial storage information in the target storage node corresponding to the client request information is in a locked state; a generating unit configured to update the initial storage information based on the client request information to generate updated storage information in response to the initial storage information not being in a locked state; and the parallel distribution unit is configured to distribute the updated storage information to the distributed storage nodes in parallel.
Optionally, the client request information includes: the client requests the information identification information, and the apparatus further comprises: and generating lock information according to the client request information identification information and the timestamp corresponding to the current time.
Optionally, the generating unit is further configured to: and updating the initial storage information based on the client request information in response to the generation of the lock information to generate updated storage information.
Optionally, the client request information further includes: the client requests data; and the apparatus further comprises: in response to determining that the initial storage information is in a locked state, determining whether first identification information and second identification information are matched, wherein the first identification information is lock identification information included in lock information corresponding to the initial storage information, and the second identification information is client request information identification information; and updating the time stamp included in the lock information corresponding to the initial storage information to the time stamp corresponding to the current time in response to determining that the first identification information and the second identification information are matched.
Optionally, the apparatus further comprises: in response to determining that the first identification information and the second identification information are not matched, determining a difference value between a timestamp included in the lock information corresponding to the initial storage information and a timestamp corresponding to the current time to generate a lock-in duration; and in response to the fact that the lock existence time length is determined to be greater than or equal to the preset time length, updating the first identification information to target identification information, and updating a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
Optionally, the generating unit is further configured to: and updating data included in the initial storage information based on the client request data to generate updated storage information.
Optionally, the apparatus further comprises: and sending the updated storage information to the target client for display.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: the data writing efficiency can be improved through the data processing method of some embodiments of the disclosure. Specifically, the reasons for the low efficiency of data writing are: the existing distributed system only has one storage node for providing writing service, and when the existing distributed system faces massive request information, the efficiency of data writing is low. In addition, in actual situations, the individual client may be in a standby state when executing the requested task. The distributed storage system cannot automatically skip the request task of the client and accept the request tasks of other clients, thereby reducing the efficiency of data processing. Based on this, in the data processing method according to some embodiments of the present disclosure, on one hand, by designing a plurality of storage nodes for providing write service, it is further ensured that the plurality of storage nodes can respond when a large number of requests enter the distributed storage system, thereby providing write service for data. On the other hand, the judgment of the lock information corresponding to the client request information is added to determine whether the client is in a standby state when executing the request task. And if the client is in the standby state, updating the lock information corresponding to the client so that the distributed system can skip the client to continue receiving the request information. Because a plurality of storage nodes in the distributed storage system can provide data writing service to the outside and increase the judgment on the lock information corresponding to the client request information, the distributed storage system can automatically skip individual clients in a standby state to receive the request information sent by other clients. Thereby improving the efficiency of data writing.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of an application scenario of a data processing method according to some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a data processing method according to the present disclosure;
FIG. 3 is an exemplary diagram of a lock information table in some embodiments of a data processing method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a data processing method according to the present disclosure;
FIG. 5 is a schematic block diagram of some embodiments of a data processing apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a data processing method of some embodiments of the present disclosure.
In the application scenario of fig. 1, first, in response to receiving the client request information 102 (e.g., "client a, 1") sent by the target client, the computing device 101 may determine, from the set of distributed storage nodes (e.g., "tivv 1, tivv 2, tivv 3"), a target storage node (e.g., "tivv 1") corresponding to the client request information 102. Then, the computing device 101 may determine whether the initial storage information 103 (e.g., "client a, 2") in the target storage node corresponding to the client request information 102 is in a locked state. Thereafter, the computing device 101 may update the initial storage information 103 based on the client request information 102 to generate updated storage information 104 (e.g., "client a, 3") in response to the initial storage information 103 not being in a locked state. Finally, the computing device 101 may distribute the above-described updated storage information 104 to the respective distributed storage nodes in parallel.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a data processing method according to the present disclosure is shown. The data processing method comprises the following steps:
step 201, in response to receiving client request information sent by a target client, determining a target storage node corresponding to the client request information from a distributed storage node set.
In some embodiments, an execution subject of the data processing method (for example, the computing device 101 shown in fig. 1) may determine a target storage node corresponding to the client request information according to the storage node identifier included in the client request information. The storage node identifier may be configured to query a storage node corresponding to the client request information.
The target storage node may be hardware for storing data. The target storage node may be a disk. The distributed storage node may be a server for storing data. The distributed storage node set can be used for characterizing a system which combines a plurality of servers to provide services to the outside. Each distributed storage node in the set of distributed storage nodes may form a key-value store for characterizing distributed transactions. Each distributed storage node in the set of distributed storage nodes may also constitute a system for characterizing a distributed key-value pair storage system.
As an example, the storage node identifier included in the client request information may be: "storage node 1". The distributed storage node set may be storage node 1, storage node 2, storage node 3, storage node 4. The target storage node to which the client request information corresponds may be storage node 1.
Step 202, determining whether the initial storage information in the target storage node corresponding to the client request information is in a locked state.
In some embodiments, the execution agent may determine whether the initial storage information in the target storage node corresponding to the client request information is in a locked state by querying whether lock information corresponding to the client request information exists in a lock information table. Wherein, the lock information may include: request identification information and lock name. The client request information may include: request identification information and request data. The initial storage information is initial information stored in the target storage node. The initial storage information may include: identification information and initial storage data are requested.
As an example, the lock information table may be as shown in fig. 3. Wherein, the lock information in the lock information table may include: request identification information 301, lock name 302. In the lock information table, an SQL (Structured Query language) statement for querying whether lock information corresponding to the client request information exists may be "select from lock information table where ID is" request identification information ".
And step 203, responding to the initial storage information not in the locked state, updating the initial storage information based on the client request information to generate updated storage information.
In some embodiments, the execution agent may determine that lock information corresponding to the client request information does not exist in the lock information table. And accumulating the request data included in the client request information and the initial storage data included in the initial storage information to generate updated storage information.
In some optional implementations of some embodiments, the execution subject may determine that there is no lock information corresponding to the client request information in the lock information table. And combining the lock name included in the lock information and the request identification information included in the client request information to generate lock information, and adding the lock information to the lock information table. The method and the device have the advantages that the lock information corresponding to the client request information initiated by the target client is added in the lock information table, so that the problem that initial storage data included in the initial storage information stored in the target storage node is disordered when other clients initiate the client request information identical to the client request information is avoided. Next, the execution body may accumulate request data included in the client request information and initial storage data included in the initial storage information to generate updated storage information.
As an example, the lock information corresponding to the client request information may include a lock name [ Tesk _ lock: "Tesk _ lockA" ]. The client request identification information included in the client request information may be [ ID: "A" ]. Combining the lock name included in the lock information and the client request identification information included in the client request information to generate the lock information may be [ ID: "A", Tesk _ lock: "Tesk _ lockA" ]. And adds the lock information to the lock information table. The client request information may be [ ID: "A", data: "1"]. The above-mentioned initial storage information may be [ ID: "A", data: "1"]. The generating of the updated storage information by accumulating the request data included in the client request information and the initial storage data included in the initial storage information may be [ ID: "A", data: "2"].
And step 204, distributing the updated storage information to each distributed storage node in parallel.
In some embodiments, the execution entity may distribute the updated storage information to the distributed storage nodes in parallel through a consistency algorithm. The consistency algorithm can be used for copying and distributing the updated storage information data so as to keep the data contents in different data storage nodes consistent. The data consistency algorithm can be a Paxos algorithm or a Raft consensus algorithm.
The above embodiments of the present disclosure have the following advantages: the data writing efficiency can be improved through the data processing method of some embodiments of the disclosure. Specifically, the reasons for the low efficiency of data writing are: the existing distributed system only has one storage node for providing writing service, and when the existing distributed system faces massive request information, the efficiency of data writing is low. In addition, in actual situations, the individual client may be in a standby state when executing the requested task. The distributed storage system cannot automatically skip the request task of the client and accept the request tasks of other clients, thereby reducing the efficiency of data processing. Based on this, in the data processing method according to some embodiments of the present disclosure, on one hand, by designing a plurality of storage nodes for providing write service, it is further ensured that the plurality of storage nodes can respond when a large number of requests enter the distributed storage system, thereby providing write service for data. On the other hand, the judgment of the lock information corresponding to the client request information is added to determine whether the client is in a standby state when executing the request task. And if the client is in the standby state, updating the lock information corresponding to the client so that the distributed system can skip the client to continue receiving the request information. Because a plurality of storage nodes in the distributed storage system can provide data writing service to the outside and increase the judgment on the lock information corresponding to the client request information, the distributed storage system can automatically skip individual clients in a standby state to receive the request information sent by other clients. Thereby improving the efficiency of data writing.
With further reference to FIG. 4, a flow 400 of further embodiments of a data processing method is shown. The flow 400 of the data processing method includes the following steps:
step 401, in response to receiving client request information sent by a target client, determining a target storage node corresponding to the client request information from a distributed storage node set.
Step 402, determining whether the initial storage information in the target storage node corresponding to the client request information is in a locked state.
In some embodiments, the specific implementation and technical effects of steps 401 and 402 can refer to steps 201 and 202 in the embodiments corresponding to fig. 2, and are not described herein again.
Step 403, generating lock information according to the client request information identification information and the timestamp corresponding to the current time.
In some embodiments, the execution subject may generate the lock information according to the client request information identification information and a timestamp corresponding to the current time in response to that the initial storage information is not in the locked state. The execution main body may determine that the initial storage information in the target storage node corresponding to the client request information is not in a locked state by querying that no lock information corresponding to the client request information exists in the lock information table. Wherein, the lock information may include: lock identification information, lock name, and timestamp. The client request information may include: client request identification information and client request data.
The execution agent may determine the client request identification information included in the client request information as the lock identification information included in the lock information. And updating the timestamp included in the lock information to a timestamp corresponding to the current time to generate the lock information.
As an example, the client request identification information included in the client request information may be [ ID: "A" ]. The timestamp corresponding to the current time may be "1610196326". The lock information may be [ ID: "A", Tesk _ lock: "Tesk _ lockA", time: "1610196325"]. The generated lock information may be [ ID: "A", Tesk _ lock: "Tesk _ lockA", time: "1610196326"].
In response to generating the lock information, the initial storage information is updated based on the client request information to generate updated storage information, step 404.
In some embodiments, the execution agent may determine that the lock information has been generated, and determine data included in the initial storage information as client request data included in the client request information to generate the updated storage information.
As an example, the generated lock information may be [ ID: "A", Tesk _ lock: "Tesk _ lockA", time: "1610196326"]. The above-mentioned initial storage information may be [ ID: "A", data: "1"]. The client request information may be [ ID: "A", data: "2"]. The data included in the initial storage information is determined as the request data included in the client request information, so as to generate the updated storage information, which may be [ ID: "A", data: "2"].
In some optional implementations of some embodiments, the execution subject may determine that the lock information has been generated, and perform data update on data included in the initial storage information according to client request data included in the client request information. The execution body may add the client request data included in the client request information and the data included in the initial storage information to generate updated storage information, thereby implementing data update.
As an example, the generated lock information may be [ ID: "A", Tesk _ lock: "Tesk _ lockA", time: "1610196326"]. The above-mentioned initial storage information may be [ ID: "A", data: "1"]. The client request information may be [ ID: "A", data: "2"]. The client request data included in the client request information and the data included in the initial storage information are added to generate updated storage information, which may be [ ID: "A", data: "3"].
And step 405, distributing the updated storage information to each distributed storage node in parallel.
In some embodiments, the specific implementation of step 405 and the technical effect brought by the implementation may refer to step 204 in those embodiments corresponding to fig. 2, which are not described herein again.
Optionally, the execution main body may send the update storage information to the target client for display.
The execution main body can send the updated storage information to the target client side for display through a wired connection mode or a wireless connection mode.
In response to determining that the initial stored information is in a locked state, step 406 determines whether the first identifying information and the second identifying information match.
In some embodiments, the execution agent may first determine that lock information corresponding to the client request information exists in the lock information table. Next, the execution body may determine whether the first identification information and the second identification information match. The first identification information may be lock identification information included in lock information corresponding to the initial storage information, and the second identification information may be client request information identification information. The execution body may determine whether the first identification information and the second identification information match by determining whether the first identification information and the second identification information are the same.
As an example, the client request information may be [ ID: "A", data: "1"]. The lock information may be [ ID: "A", Tesk _ lock: "Tesk _ lockA", time: "1610196326"]. The first identification information may be [ ID: "A" ]. The second identification information may be [ ID: "A" ].
Step 407, in response to determining that the first identification information and the second identification information match, updating the timestamp included in the lock information corresponding to the initial storage information to the timestamp corresponding to the current time.
In some embodiments, the executing entity may determine that the first identification information matches the second identification information, and update a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
As an example, the above-described first identification information may be [ ID: "A" ]. The second identification information may be [ ID: "A" ]. The timestamp included in the lock information corresponding to the initial storage information may be [ time: "1610196326"]. The timestamp updated to the current time may be [ time: "1610196356"].
Step 408, in response to determining that the first identification information and the second identification information do not match, determining a difference value between a timestamp included in the lock information corresponding to the initially stored information and a timestamp corresponding to the current time to generate a lock-in duration.
In some embodiments, the execution subject may first determine that the first identification information and the second identification information do not match. And secondly, determining the difference value of the timestamp included in the lock information and the timestamp corresponding to the current time to generate the latch-in duration.
As an example, the above-described first identification information may be [ ID: "A" ]. The second identification information may be [ ID: "B" ]. The lock information may include a timestamp of [ time: "1610196326"]. The current timestamp may be [ time: "1610196356"]. The latch generated may be 30 seconds in duration.
Step 409, in response to determining that the latch time length is greater than or equal to the preset time length, updating the first identification information to the target identification information, and updating the timestamp included in the lock information corresponding to the initial storage information to the timestamp corresponding to the current time.
In some embodiments, the execution subject may determine that the latch has a duration greater than or equal to a preset duration, and update the first identification information to the target identification information. The first identification information may be lock identification information included in lock information corresponding to client request information of the target client. The target identification information may be target lock identification information included in lock information corresponding to the client request information of any one of the clients other than the target client. And updating the first identification information to the target identification information, and updating a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
As an example, the preset time period may be 10 seconds.
As can be seen from fig. 4, compared with the description of some embodiments corresponding to fig. 2, the flow 400 of the information processing method in some embodiments corresponding to fig. 4 adds a determination process for lock information corresponding to client request information. Thereby determining whether the client is in a standby state when requesting information. And if the client is in the standby state, updating the lock information corresponding to the request information of the client so that the distributed system can skip the client to continue receiving the request information. Due to the fact that judgment of the lock information corresponding to the client request information is added, the situation that other clients cannot request the information is avoided, and therefore data writing efficiency is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a data processing apparatus, which correspond to those shown in fig. 2, and which may be applied in particular to various electronic devices.
As shown in fig. 5, the data processing apparatus 500 of some embodiments includes: a first determining unit 501, a second determining unit 502, a generating unit 503, and a parallel distributing unit 504. The first determining unit 501 is configured to, in response to receiving client request information sent by a target client, determine a target storage node corresponding to the client request information from a distributed storage node set; a second determining unit 502, configured to determine whether initial storage information in the target storage node corresponding to the client request information is in a locked state; a generating unit 503 configured to update the initial storage information based on the client request information to generate updated storage information in response to the initial storage information not being in a locked state; a parallel distribution unit 504 configured to distribute the updated storage information to the distributed storage nodes in parallel.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
In an optional implementation of some embodiments, the client request information includes: the client requests the information identification information, and the apparatus 500 further comprises: and generating lock information according to the client request information identification information and the timestamp corresponding to the current time.
In an optional implementation of some embodiments, the generating unit 503 is further configured to: and updating the initial storage information based on the client request information in response to the generation of the lock information to generate updated storage information.
In an optional implementation manner of some embodiments, the client request information further includes: the client requests data; and the apparatus 500 further comprises: in response to determining that the initial storage information is in a locked state, determining whether first identification information and second identification information are matched, wherein the first identification information is lock identification information included in lock information corresponding to the initial storage information, and the second identification information is client request information identification information; and updating the time stamp included in the lock information corresponding to the initial storage information to the time stamp corresponding to the current time in response to determining that the first identification information and the second identification information are matched.
In an optional implementation of some embodiments, the apparatus 500 further comprises: in response to determining that the first identification information and the second identification information are not matched, determining a difference value between a timestamp included in the lock information corresponding to the initial storage information and a timestamp corresponding to the current time to generate a lock-in duration; and in response to the fact that the lock existence time length is determined to be greater than or equal to the preset time length, updating the first identification information to target identification information, and updating a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
In an optional implementation of some embodiments, the generating unit 503 is further configured to: and updating data included in the initial storage information based on the client request data to generate updated storage information.
In an optional implementation of some embodiments, the apparatus 500 further comprises: and sending the updated storage information to the target client for display.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., computing device 101 of FIG. 1)600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 604 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the apparatus; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to receiving client request information sent by a target client, determining a target storage node corresponding to the client request information from a distributed storage node set; determining whether initial storage information in the target storage node corresponding to the client request information is in a locked state; in response to the initial storage information not being in a locked state, updating the initial storage information based on the client request information to generate updated storage information; and distributing the updated storage information to each distributed storage node in parallel.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a first determining unit, a second determining unit, a generating unit, and a parallel distributing unit. The names of these units do not form a limitation on the units themselves in some cases, for example, the first determining unit may also be described as "a unit that determines, from the distributed storage node set, a target storage node corresponding to client request information sent by a target client in response to receiving the client request information.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method of data processing, comprising:
in response to receiving client request information sent by a target client, determining a target storage node corresponding to the client request information from a distributed storage node set;
determining whether initial storage information in the target storage node corresponding to the client request information is in a locked state;
updating the initial storage information based on the client request information to generate updated storage information in response to the initial storage information not being in a locked state;
and distributing the updated storage information to each distributed storage node in parallel.
2. The method of claim 1, wherein the client requesting information comprises: the client requests information identification information; and
before the updating the initial storage information based on the client request information to generate updated storage information, the method further includes:
and generating lock information according to the client request information identification information and the timestamp corresponding to the current time.
3. The method of claim 2, wherein the updating the initial stored information based on the client request information comprises:
in response to generating the lock information, updating the initial storage information based on the client request information to generate updated storage information.
4. The method of claim 3, wherein the client requesting information further comprises: the client requests data; and
the method further comprises the following steps:
in response to determining that the initial storage information is in a locked state, determining whether first identification information and second identification information are matched, wherein the first identification information is lock identification information included in lock information corresponding to the initial storage information, and the second identification information is client request information identification information;
and in response to determining that the first identification information and the second identification information are matched, updating a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
5. The method of claim 4, wherein the method further comprises:
in response to determining that the first identification information and the second identification information are not matched, determining a difference value between a timestamp included in the lock information corresponding to the initial storage information and a timestamp corresponding to the current time to generate a lock-in duration;
and in response to the fact that the lock existence time length is determined to be greater than or equal to the preset time length, updating the first identification information to target identification information, and updating a timestamp included in the lock information corresponding to the initial storage information to a timestamp corresponding to the current time.
6. The method of claim 5, wherein the updating the initial stored information based on the client request information to generate updated stored information comprises:
and updating data included in the initial storage information based on the client request data to generate updated storage information.
7. The method of claim 1, wherein the method further comprises:
and sending the updated storage information to the target client for display.
8. A data processing apparatus comprising:
the first determining unit is configured to respond to the receiving of client request information sent by a target client, and determine a target storage node corresponding to the client request information from a distributed storage node set;
a second determining unit configured to determine whether initial storage information in the target storage node corresponding to the client request information is in a locked state;
a generating unit configured to update the initial storage information based on the client request information to generate updated storage information in response to the initial storage information not being in a locked state;
a parallel distribution unit configured to distribute the updated storage information to the respective distributed storage nodes in parallel.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-7.
CN202110110875.7A 2021-01-27 2021-01-27 Data processing method and device, electronic equipment and computer readable medium Pending CN113760927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110110875.7A CN113760927A (en) 2021-01-27 2021-01-27 Data processing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110110875.7A CN113760927A (en) 2021-01-27 2021-01-27 Data processing method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113760927A true CN113760927A (en) 2021-12-07

Family

ID=78786470

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110110875.7A Pending CN113760927A (en) 2021-01-27 2021-01-27 Data processing method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113760927A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560864A (en) * 2023-07-06 2023-08-08 苏州浪潮智能科技有限公司 Method, device, system, equipment and storage medium for realizing distributed lock

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560864A (en) * 2023-07-06 2023-08-08 苏州浪潮智能科技有限公司 Method, device, system, equipment and storage medium for realizing distributed lock
CN116560864B (en) * 2023-07-06 2023-11-03 苏州浪潮智能科技有限公司 Method, device, system, equipment and storage medium for realizing distributed lock

Similar Documents

Publication Publication Date Title
CN111800513B (en) Method and device for pushing information and computer readable medium of electronic equipment
CN110909521A (en) Synchronous processing method and device for online document information and electronic equipment
CN111338834B (en) Data storage method and device
CN112416632A (en) Event communication method and device, electronic equipment and computer readable medium
CN113760991A (en) Data operation method and device, electronic equipment and computer readable medium
CN116433388B (en) Data storage resource partitioning method, device, electronic equipment and computer medium
CN113760927A (en) Data processing method and device, electronic equipment and computer readable medium
CN113791891A (en) Continuous integration task construction method, device, equipment and computer readable medium
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN112507676B (en) Method and device for generating energy report, electronic equipment and computer readable medium
CN113760929A (en) Data synchronization method and device, electronic equipment and computer readable medium
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN114785770A (en) Mirror layer file sending method and device, electronic equipment and computer readable medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN112115154A (en) Data processing and data query method, device, equipment and computer readable medium
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN110262756B (en) Method and device for caching data
CN110633324B (en) Method, apparatus, electronic device and computer readable medium for synchronizing data
CN111314457B (en) Method and device for setting virtual private cloud
CN113704076B (en) Task optimization method and device, electronic equipment and computer readable medium
CN113722313A (en) Data write request processing method, device, equipment and computer readable medium
CN113779315A (en) Information generation method and device, electronic equipment and computer readable medium
CN114444064A (en) Account processing method and device, electronic equipment and computer readable medium
CN111404824A (en) Method, apparatus, electronic device and computer readable medium for forwarding a request
CN117520399A (en) Data storage method, apparatus, electronic device, and computer readable medium

Legal Events

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