CN114168233A - Data processing method, device, server and storage medium - Google Patents
Data processing method, device, server and storage medium Download PDFInfo
- Publication number
- CN114168233A CN114168233A CN202111358141.7A CN202111358141A CN114168233A CN 114168233 A CN114168233 A CN 114168233A CN 202111358141 A CN202111358141 A CN 202111358141A CN 114168233 A CN114168233 A CN 114168233A
- Authority
- CN
- China
- Prior art keywords
- target
- account
- data
- modified
- request message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/70—Game security or game management aspects
- A63F13/79—Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/50—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
- A63F2300/55—Details of game data or player data management
- A63F2300/5546—Details of game data or player data management using player registration data, e.g. identification, account, preferences, game history
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Computer Security & Cryptography (AREA)
- General Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The disclosure relates to a data processing method, a data processing device, a server and a storage medium, and relates to the technical field of communication. The method comprises the following steps: receiving a data modification request message, wherein the data modification request message comprises an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used for modifying data corresponding to the account to be modified; determining a process to be confirmed based on the identification of the account to be modified, wherein the process to be confirmed is a process corresponding to the account to be modified; and when the process to be confirmed is different from the target process, calling the target service in the target process so as to modify the data corresponding to the account to be modified. The scheme provided by the disclosure can improve the efficiency of data modification and improve the user experience.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a data processing method, an apparatus, a server, and a storage medium.
Background
Currently, data related to a certain account may be stored in a plurality of different processes, and when a certain function needs to be updated, the data related to the account may be modified in each of the plurality of different processes.
However, in the above method, since some identical data corresponding to the account may exist in the plurality of different processes, when the related data of the account is modified, the identical data needs to be modified for a plurality of times, which may affect the efficiency of data modification and reduce the user experience.
Disclosure of Invention
The present disclosure provides a data processing method, an apparatus, a server and a storage medium, which solve the technical problems that the efficiency of data modification is affected and the user experience is reduced by modifying the same data for many times in the prior art.
The technical scheme of the embodiment of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, a data processing method is provided. The method can comprise the following steps: receiving a data modification request message, wherein the data modification request message comprises an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used for modifying data corresponding to the account to be modified; determining a process to be confirmed based on the identification of the account to be modified, wherein the process to be confirmed is a process corresponding to the account to be modified; and when the process to be confirmed is different from the target process, calling the target service in the target process.
Optionally, the determining the process to be confirmed based on the identifier of the account to be modified specifically includes: carrying out hash transformation on the identification of the account to be modified to obtain a target hash value; and determining the process to be confirmed based on the target hash value.
Optionally, the data modification request message further includes an identifier of a first thread, where the first thread is a thread corresponding to the target service; the invoking the target service in the target process specifically includes: the target service is invoked in the first thread of the target process.
Optionally, the data processing method further includes: determining a second thread based on the target hash value, wherein the second thread is a thread corresponding to the account to be modified; and adding the target hash value to a target queue, wherein the target queue is a queue corresponding to the second thread.
Optionally, the data processing method further includes: when first receiving time is before second receiving time, preferentially acquiring a first hash value and preferentially processing a first data modification request message, wherein the first hash value is one of M hash values included in the target queue, the first data modification request message is a data modification request message corresponding to the first hash value, the first receiving time is the receiving time of the first data modification request message, the second receiving time is the receiving time of a second modification request message, the second data modification request message is a data modification request message corresponding to a second hash value, the second hash value is a hash value of the M hash values except the first hash value, and M is greater than or equal to 1; and after a preset time interval, acquiring the second hash value and processing the second data modification request message.
Optionally, the target queue is a non-blocking queue.
Optionally, the data processing method further includes: and when the process to be confirmed is the same as the target process, determining to call the target service in the process to be confirmed.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing apparatus. The data processing apparatus may include: the device comprises a receiving module, a determining module and a processing module; the receiving module is configured to receive a data modification request message, where the data modification request message includes an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used to modify data corresponding to the account to be modified; the determining module is configured to determine a process to be confirmed based on the identifier of the account to be modified, where the process to be confirmed is a process corresponding to the account to be modified; the processing module is configured to call the target service in the target process to modify the data corresponding to the account to be modified when the process to be confirmed is different from the target process.
Optionally, the processing module is further configured to perform hash transformation on the identifier of the account to be modified to obtain a target hash value; the determining module is specifically configured to determine the process to be validated based on the target hash value.
Optionally, the data modification request message further includes an identifier of a first thread, where the first thread is a thread corresponding to the target service; the processing module is specifically configured to invoke the target service in the first thread of the target process.
Optionally, the determining module is further configured to determine, based on the target hash value, a second thread, where the second thread is a thread corresponding to the account to be modified; the processing module is further configured to add the target hash value to a target queue, the target queue being a queue corresponding to the second thread.
Optionally, the processing module is further configured to preferentially obtain a first hash value and preferentially process a first data modification request message when a first receiving time is before a second receiving time, where the first hash value is one of M hash values included in the target queue, the first data modification request message is a data modification request message corresponding to the first hash value, the first receiving time is a receiving time of the first data modification request message, the second receiving time is a receiving time of a second modification request message, the second data modification request message is a data modification request message corresponding to a second hash value, M is greater than or equal to 1, of the M hash values, except for the first hash value; the processing module is further configured to obtain the second hash value and process the second data modification request message after a preset time interval.
Optionally, the target queue is a non-blocking queue.
Optionally, the determining module is further configured to determine to invoke the target service in the process to be confirmed when the process to be confirmed is the same as the target process.
According to a third aspect of the embodiments of the present disclosure, there is provided a server, which may include: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the above-described optional data processing methods of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having instructions stored thereon, which, when executed by a server, enable the server to perform any one of the above-mentioned optional data processing methods of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer instructions which, when run on a server, cause the server to perform the optional data processing method of any one of the first aspects.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
based on any one of the above aspects, in the present disclosure, the server may receive a data modification request message, where the data modification request message includes an identifier of an account to be modified and an identifier of a target process, where the target process is a process corresponding to a target service, and the target service is configured to modify data corresponding to the account to be modified; then the server determines a process corresponding to the account to be modified, namely a process to be confirmed, based on the identifier of the account to be modified; when the process to be confirmed is different from the target process, it is indicated that the data corresponding to the target service and the data corresponding to the account to be modified are not in the same process (or logical server node), so that the server can call the target service in the target process (i.e., the process corresponding to the target service) to modify the data corresponding to the account to be modified. In the embodiment of the disclosure, the server determines to call the target service in a certain process (for example, a target process) without modifying the data corresponding to the account to be modified for multiple times, so as to modify the data corresponding to the account to be modified in a fixed process (i.e., a process to be confirmed), which can improve the efficiency of modifying the data and improve the user experience.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram of a data processing system provided by an embodiment of the present disclosure;
FIG. 2 illustrates an internal schematic diagram of a logical server node provided by an embodiment of the present disclosure;
fig. 3 is a flow chart illustrating a data processing method provided by an embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating a further data processing method provided by an embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating a further data processing method provided by an embodiment of the present disclosure;
FIG. 6 is a flow chart illustrating a further data processing method provided by an embodiment of the present disclosure;
FIG. 7 is a flow chart illustrating a further data processing method provided by an embodiment of the present disclosure;
FIG. 8 is a flow chart illustrating a further data processing method provided by an embodiment of the present disclosure;
FIG. 9 is a flow chart illustrating a further data processing method provided by an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a data processing apparatus provided in an embodiment of the present disclosure;
fig. 11 shows a schematic structural diagram of another data processing apparatus provided in the embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and/or components.
The data to which the present disclosure relates may be data that is authorized by a user or sufficiently authorized by parties.
As described in the background art, in the prior art, the same data may exist in a plurality of different processes corresponding to a certain account, so that when the related data of the account needs to be modified, that is, the same data needs to be modified for a plurality of times, the efficiency of data modification may be affected, and the user experience may be reduced. Based on this, the embodiment of the present disclosure provides a data processing method, where a server determines to call a target service in a certain process (for example, a target process) without modifying data corresponding to an account to be modified for multiple times, so as to modify the data corresponding to the account to be modified in a fixed process (for example, a process to be confirmed), so that efficiency of data modification can be improved, and user experience is improved.
The data processing method, the data processing device, the server and the storage medium provided by the embodiment of the disclosure are applied to a scene of data modification (specifically, modification of data corresponding to a certain account (or player)). When the server receives the data modification request message, the target service may be called in a certain process (e.g., a target process) according to the method provided by the embodiment of the present disclosure, so as to modify the data corresponding to the account to be modified.
The data processing method provided by the embodiment of the disclosure is exemplarily described below with reference to the accompanying drawings:
fig. 1 is a schematic diagram of a data processing system according to an embodiment of the present disclosure, as shown in fig. 1, the data processing system may include an electronic device 101 and a server 102, and the electronic device 101 may establish a connection with the server 102 through a wired network or a wireless network.
The electronic device 101 may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) device, a Virtual Reality (VR) device, or other devices that can be installed and used for a content community application, and the disclosure does not specifically limit the specific form of the electronic device 101. The system can be used for man-machine interaction with a user through one or more modes of a keyboard, a touch pad, a touch screen, a remote controller, voice interaction or handwriting equipment and the like.
Specifically, the electronic device 101 may send a data modification request message to the server 102, so that the server 102 may receive the data modification request message and determine the to-be-confirmed process based on the identity of the account to be modified. And then calling the target service in the target process so as to modify the data corresponding to the account to be modified based on the target service.
In an implementation manner of the embodiment of the present disclosure, the server 102 may include at least one process, and it may also be understood that the server 102 includes at least one logical server node, and one logical server node is one process, and further, each logical server node in the at least one logical server node may be logically divided in function.
As shown in fig. 2, one logical server node may be divided into a 5-tier structure, including: a function layer (module)201, a service layer (service)202, a scheduling thread layer (worker)203, a node process layer (node)204, and a global routing layer (router) 205.
Specifically, the functional layer 201 is used to store a static method (or data) written by a functional programmer, for example, in a game application scenario, the static method may be how a certain skill is implemented, and the functional layer 201 may further send data to the service layer 202.
The service layer 202 is used to store service contents or service data that the service layer 202 can provide, and receive data sent by the functional layer 201. In the embodiment of the disclosure, the server calls the target service, that is, calls the target service at the service layer corresponding to the target service. In one implementation of the disclosed embodiments, the interface of the functional layer and the interface of the service layer may be opened to a functional programmer, so that the functional programmer may modify data at the functional layer and the service layer.
The scheduling thread layer 203 is a layer for thread work, and can also be understood as just one thread, all work is finally executed in the worker layer, and the calling of the message is realized from the function layer to the scheduling thread layer. In the embodiment of the present disclosure, the thread scheduling layer is further configured to store a certain queue.
The node process layer 204 is used to characterize a process (or a logical server node), which may include multiple threads. In the embodiment of the present disclosure, the server may determine whether a process (i.e., a process to be confirmed) corresponding to the account to be modified is the same as a process (i.e., a target process) corresponding to the target service, and then invoke the target service in the target process (or the process to be confirmed).
The global routing layer 205 is configured to store a routing table, and may specifically determine an Internet Protocol (IP) address of a certain server through zookeeper.
As shown in fig. 3, the data processing method provided by the embodiment of the present disclosure may include S101-S103.
S101, the server receives a data modification request message.
The data modification request message includes an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used for modifying data corresponding to the account to be modified.
It should be understood that a plurality of logical server nodes (or a plurality of processes) may be included in the network, the plurality of logical server nodes may all belong to the server or may belong to a plurality of different servers, each of the plurality of logical server nodes may register its corresponding (or may provide) plurality of services in the zookeeper, and thus, other logical server nodes (i.e., logical server nodes other than each of the plurality of logical server nodes) may perform service discovery through the zookeeper, and specifically, the other logical server nodes may determine (or discover) the plurality of services provided by each of the logical server nodes. Finally, each logical server node may determine a plurality of services that any one of the other logical server nodes may provide, thereby specifying a service (e.g., a target service), and then invoke the service within the logical server node that may provide the service.
That is, the target process may provide multiple services, the target service is one of the multiple services, data corresponding to the target service is stored in the target process, and the server may invoke the target service to modify the data corresponding to the account to be modified.
S102, the server determines a process to be confirmed based on the identification of the account to be modified.
And the process to be confirmed is a process corresponding to the account to be modified.
It should be understood that the to-be-confirmed process is a process storing data corresponding to the account to be modified. After the server receives the data modification request message, a processing process corresponding to the data modification request message (or it may be understood that the data modification request message is allocated to the processing process) may be determined based on the identifier of the account to be modified, where the processing process is a process corresponding to the account to be modified, that is, the process to be confirmed.
In an implementation manner of the embodiment of the present disclosure, in a game scene, the account to be modified may be a certain game player, and the identifier of the account to be modified may be an ID of the game player.
S103, when the process to be confirmed is different from the target process, the server calls the target service in the target process so as to modify the data corresponding to the account to be modified.
It should be understood that when the process to be confirmed is different from the target process, the process (or logical server node) for storing the data corresponding to the target service is different from the process for storing the data corresponding to the account to be modified. In the embodiment of the present disclosure, when the two processes are different, the server may invoke the target service in the target process (i.e., the process corresponding to the target service).
In connection with the game scenario, the data modification request message may be understood as an instruction issued by a game player through an electronic device, where the instruction is used to indicate a certain game behavior of the game player, such as applying a target skill. The target service is the service which stores the target skill, and the server modifies the data corresponding to the game player by calling the target service, so that the process of releasing the target skill can be completed.
In one implementation of the disclosed embodiment, when the server calls the target service and needs to get a return value (which may be understood as a registration callback), for example, in the game scenario described above, the server needs to determine whether the target skill was successfully released. The server can obtain the return value of whether the release is successful, and then return (or send) the return value to the electronic device.
The technical scheme provided by the embodiment can at least bring the following beneficial effects: as can be seen from S101-S103, the server may receive a data modification request message, where the data modification request message includes an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is configured to modify data corresponding to the account to be modified; then the server determines a process corresponding to the account to be modified, namely a process to be confirmed, based on the identifier of the account to be modified; when the process to be confirmed is different from the target process, it is indicated that the data corresponding to the target service and the data corresponding to the account to be modified are not in the same process (or logical server node), so that the server can call the target service in the target process (i.e., the process corresponding to the target service) to modify the data corresponding to the account to be modified. In the embodiment of the disclosure, the server determines to call the target service in a certain process (for example, a target process) without modifying the data corresponding to the account to be modified for multiple times, so as to modify the data corresponding to the account to be modified in a fixed process (i.e., a process to be confirmed), which can improve the efficiency of modifying the data and improve the user experience.
With reference to fig. 3, as shown in fig. 4, in an implementation manner of the embodiment of the present disclosure, the determining a process to be confirmed based on an identifier of an account to be modified specifically includes S1021-S1022.
And S1021, the server performs hash transformation on the identification of the account to be modified to obtain a target hash value.
It should be understood that the identifier of the account to be modified may be longer (or larger), the server performs hash on the identifier of the account to be modified, and may redirect the account to be modified (specifically, the data modification request message corresponding to the account to be modified) to a logical server node (i.e., the process to be confirmed), and since the target hash value (i.e., the hash value corresponding to the identifier of the account to be modified) is unchanged, each data modification request message corresponding to the account to be modified is redirected to the same process to be confirmed.
And S1022, the server determines the process to be confirmed based on the target hash value.
In one implementation of the disclosed embodiment, the server may determine the process to be confirmed based on the target hash value and a modulo of a total number of processes (or logical server nodes) included in the network.
The technical scheme provided by the embodiment can at least bring the following beneficial effects: as known from S1021 to S1022, the server may perform hash transformation on the identifier of the account to be modified to obtain a target hash value, and determine a process to be confirmed (i.e., a process corresponding to the account to be modified) based on the target hash value. In the embodiment of the disclosure, the server may determine a unique unchangeable process for the account to be modified based on the target hash value, and then modify the data in the unique unchangeable process. The determining efficiency of the process to be confirmed can be improved, and the accuracy of data modification is further improved.
With reference to fig. 3, as shown in fig. 5, in an implementation manner of the embodiment of the present disclosure, the data modification request message further includes an identifier of a first thread, where the first thread serves a corresponding thread for the target. The invoking of the target service in the target process may specifically include S1031.
And S1031, the server calls the target service in the first thread of the target process.
It should be understood that each of the plurality of processes described above may include multiple threads. The first thread is one of a plurality of threads included in the target process.
Specifically, the service that the target process can provide includes a service that each thread of a plurality of threads included in the target process can provide, and each thread can provide at least one service. When each logical server node is registered in the zookeeper, the services that can be provided by each thread can be registered in the zookeeper, so that other processes (or threads) can determine the services that can be provided by each thread.
It will be appreciated that the data modification request message also includes an identification of the target service, and the server may determine the target service based on the identification of the target service, and then invoke the target service from the first thread of the target process.
The technical scheme provided by the embodiment can at least bring the following beneficial effects: s1031 shows that the server may invoke the target service in the first thread of the target process, that is, may specifically invoke the target service in a certain thread, and may accurately and effectively determine the memory space where the data corresponding to the target service is located, thereby improving the accuracy of service invocation.
With reference to fig. 4, as shown in fig. 6, the data processing method provided by the embodiment of the present disclosure further includes S104-S105.
S104, the server determines a second thread based on the target hash value.
And the second thread is a thread corresponding to the account to be modified.
In combination with the above description of the embodiment, it should be understood that the process to be confirmed may also include multiple threads, and the second thread is one of the multiple threads included in the process to be confirmed.
In this embodiment of the disclosure, the server may further determine the second thread based on the target hash value and a modulo of a total number of threads included in the process to be confirmed.
And S105, adding the target hash value to the target queue by the server.
Wherein, the target queue is a queue corresponding to the second thread.
It is understood that one thread in the embodiments of the present disclosure may correspond to one queue. After receiving the data modification request message, the server may allocate the data modification request message to the target queue, specifically, add the target hash value to the target queue, so that the server may process the data modification request message.
The technical scheme provided by the embodiment can at least bring the following beneficial effects: as known from S104-S105, the server may determine, based on the target hash value, a thread (i.e., a second thread) corresponding to the account to be modified, and then add the target hash value to a queue (i.e., a target queue) corresponding to the second thread. In the embodiment of the present disclosure, after receiving the data modification request message, the server may allocate the data modification request message to a queue, specifically, add a target hash value corresponding to an identifier of the account to be modified included in the data modification request message to the target queue, and then the server may process the data modification request message, complete the invocation of the target service, that is, complete the process of modifying the data of the account to be modified. The queue corresponding to each service data request message can be conveniently and quickly determined, and the data processing efficiency is further improved.
With reference to fig. 6, as shown in fig. 7, the data processing method provided by the embodiment of the present disclosure may further include S106-S107.
And S106, when the first receiving time is before the second receiving time, the server preferentially acquires the first hash value and preferentially processes the first data modification request message.
The first hash value is one of M hash values included in the target queue, the first data modification request message is a data modification request message corresponding to the first hash value, the first receiving time is a receiving time of the first data modification request message, the second receiving time is a receiving time of a second modification request message, the second data modification request message is a data modification request message corresponding to a second hash value, the second hash value is a hash value of the M hash values except the first hash value, and M is greater than or equal to 1.
It should be understood that each of the M hash values may correspond to a data modification request message, each of the M data modification request messages may correspond to a receiving time, and a receiving time may be understood as a time when a server receives a data modification request message (or an adding time, i.e., a time when a data modification request message is added to the target queue).
And S107, after the preset time interval, the server acquires a second hash value and processes the second data modification request message.
It can be understood that the M data modification request messages corresponding to the target queue are processed in a first-in first-out manner. Specifically, if the receiving time corresponding to each of the M data modification request messages is before the receiving time corresponding to other data modification request messages in the M data modification request messages (the other data modification request messages are messages other than the each of the M data modification request messages), the server may determine to preferentially acquire the hash value corresponding to the each of the data modification request messages, and preferentially process the each of the data modification request messages. And after the preset time interval, acquiring hash values corresponding to other data modification request messages in the M data modification request messages and processing the other data modification request messages.
Optionally, the preset duration may be a heartbeat of the server (i.e. a refresh frequency of the server), and may be, for example, 16ms (milliseconds), that is, one heartbeat of the server 16ms, where each heartbeat may take M hash values from the target queue, that is, process M data modification request messages.
In the embodiment of the present disclosure, the server may add a hash value from the end position (or the tail position) of the target queue, further obtain the hash value from the start position (or the head position) of the target queue, and process the data modification request message corresponding to the hash value.
The technical scheme provided by the embodiment can at least bring the following beneficial effects: as known from S106-S107, when the first reception time is before the second reception time, the server may preferentially acquire the first hash value and preferentially process the first data modification request message; and after a preset duration of the interval, the server may obtain the second hash value and process the second data modification request message. In this embodiment of the present disclosure, the server may obtain the M hash values included in the target queue according to a time sequence, and process the data modification request messages corresponding to the M hash values. The data modification request message can be processed based on a uniform standard (namely time sequence), so that the message processing efficiency can be improved, and the data processing effectiveness can be improved.
In an implementation manner of the embodiment of the present disclosure, the target queue may be a non-blocking queue.
It should be understood that the target queue is a non-blocking queue, that is, the server may continuously add the hash value to the target queue, and may also continuously obtain the hash value from the target queue based on the preset duration, so as to process the corresponding data modification request message, thereby improving the efficiency of data processing. And under the condition that the hash value does not exist in the target queue, the data modification request message is stopped being processed, so that resource waste can be reduced, and the resource utilization rate can be improved.
With reference to fig. 3, as shown in fig. 8, in an alternative implementation manner, the data processing method provided in the embodiment of the present disclosure may further include S108.
And S108, when the process to be confirmed is the same as the target process, the server determines to call the target service in the process to be confirmed.
It should be understood that, when the process to be confirmed is the same as the target process, the process for storing the data corresponding to the target service is the same as the process for storing the data corresponding to the account to be modified. In the embodiment of the present disclosure, when the two processes are the same, the server may determine to invoke the target service in the process to be confirmed (or the target process).
The technical scheme provided by the embodiment can at least bring the following beneficial effects: as known from S108, when the process to be confirmed is the same as the target process, the server may determine to invoke the target service in the process to be confirmed. In the embodiment of the disclosure, the server determines to call the target service in a certain process (for example, a process to be confirmed) without modifying the data corresponding to the account to be modified for multiple times, so as to modify the data corresponding to the account to be modified in the same process, which can improve the efficiency of data modification and improve the user experience.
As shown in fig. 9, the following describes a procedure for invoking a target service inside a server, specifically, in the process to be confirmed, by taking the process to be confirmed as the same as the target process, including S201 to S206.
S201, the second function layer sends a service scheduling request to the second scheduling thread layer.
The second functional layer is a functional layer corresponding to the account to be modified, the second scheduling thread layer is a scheduling thread layer corresponding to the account to be modified, namely a second thread, the service scheduling request comprises an identifier of a target service, an identifier of a target process and an identifier of a first thread, and the service scheduling request is used for requesting to schedule the target service;
it should be understood that the second functional layer sends the service scheduling request to the second scheduling thread, that is, the second functional layer may be understood to remotely invoke the second thread, specifically, the second functional layer invokes the second thread through a second service layer (i.e., a service layer corresponding to the account to be modified) based on a remote call Service (SRI).
S202, the second scheduling thread layer sends the service scheduling request to the second node process layer.
And the second node process layer is the node process layer corresponding to the process to be confirmed.
S203, the second node process layer determines that the process to be confirmed is the same as the target process.
With reference to the description of the above embodiment, it should be understood that the process to be confirmed is the same as the target process, which means that the data corresponding to the target service and the data corresponding to the account to be modified belong to the same process.
S204, the second node process layer sends a service scheduling request to the first scheduling thread layer.
The first scheduling thread layer is a scheduling thread layer corresponding to the first thread.
S205, the first scheduling thread layer sends the service scheduling request to the first service layer.
The first service layer is a service layer corresponding to the target service.
S206, the first service layer sends a service scheduling request to the first functional layer.
And the first functional layer is a functional layer corresponding to the target service.
The server may call a static method corresponding to the target service at the first functional layer, and then complete a modification process of data corresponding to the account to be modified.
It is understood that, in practical implementation, the server according to the embodiments of the present disclosure may include one or more hardware structures and/or software modules for implementing the corresponding data processing methods, and these hardware structures and/or software modules may constitute a server. Those of skill in the art will readily appreciate that the present disclosure can be implemented in hardware or a combination of hardware and computer software for implementing the exemplary algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
Based on such understanding, the embodiment of the present disclosure also provides a data processing apparatus, and fig. 10 shows a schematic structural diagram of the data processing apparatus provided by the embodiment of the present disclosure. As shown in fig. 10, the data processing apparatus 30 may include: a receiving module 301, a determining module 302 and a processing module 303.
The receiving module 301 is configured to receive a data modification request message, where the data modification request message includes an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used to modify data corresponding to the account to be modified.
The determining module 302 is configured to determine a process to be confirmed based on the identifier of the account to be modified, where the process to be confirmed is a process corresponding to the account to be modified.
And the processing module 303 is configured to, when the process to be confirmed is different from the target process, invoke the target service in the target process to modify the data corresponding to the account to be modified.
Optionally, the processing module 303 is further configured to perform hash transformation on the identifier of the account to be modified to obtain a target hash value.
The determining module 302 is specifically configured to determine the process to be confirmed based on the target hash value.
Optionally, the data modification request message further includes an identifier of a first thread, where the first thread serves a corresponding thread for the target.
The processing module 303 is specifically configured to invoke the target service in the first thread of the target process.
Optionally, the determining module 302 is further configured to determine, based on the target hash value, a second thread, where the second thread is a thread corresponding to the account to be modified.
The processing module 303 is further configured to add the target hash value to a target queue, where the target queue is a queue corresponding to the second thread.
Optionally, the processing module 303 is further configured to preferentially obtain a first hash value and preferentially process a first data modification request message when a first receiving time is before a second receiving time, where the first hash value is one of M hash values included in the target queue, the first data modification request message is a data modification request message corresponding to the first hash value, the first receiving time is a receiving time of the first data modification request message, the second receiving time is a receiving time of a second modification request message, the second data modification request message is a data modification request message corresponding to a second hash value, and M is greater than or equal to 1, of the M hash values except the first hash value.
A processing module 303, further configured to obtain the second hash value and process the second data modification request message after a preset time interval
Optionally, the target queue is a non-blocking queue.
Optionally, the determining module 302 is further configured to determine to invoke the target service in the process to be confirmed when the process to be confirmed is the same as the target process.
As described above, the embodiments of the present disclosure may perform division of functional modules on a data processing apparatus according to the above method example. The integrated module can be realized in a hardware form, and can also be realized in a software functional module form. In addition, it should be further noted that the division of the modules in the embodiments of the present disclosure is schematic, and is only a logic function division, and there may be another division manner in actual implementation. For example, the functional blocks may be divided for the respective functions, or two or more functions may be integrated into one processing block.
With regard to the data processing apparatus in the foregoing embodiments, the specific manner in which each module performs operations and the beneficial effects thereof have been described in detail in the foregoing method embodiments, and are not described herein again.
Fig. 11 is a schematic structural diagram of another data processing apparatus provided by the present disclosure. As shown in fig. 11, the data processing apparatus 40 may include at least one processor 401 and a memory 403 for storing processor-executable instructions. Wherein the processor 401 is configured to execute instructions in the memory 403 to implement the data processing method in the above-described embodiments.
In addition, the data processing device 40 may also include a communication bus 402 and at least one communication interface 404.
The communication interface 404 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
The memory 403 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these. The memory may be self-contained and connected to the processing unit by a bus. The memory may also be integrated with the processing unit.
The memory 403 is used for storing instructions for executing the disclosed solution, and is controlled by the processor 401. The processor 401 is configured to execute instructions stored in the memory 403 to implement the functions of the disclosed method.
In particular implementations, processor 401 may include one or more CPUs such as CPU0 and CPU1 in fig. 11 as an example.
In particular implementations, data processing device 40 may include multiple processors, such as processor 401 and processor 407 in FIG. 11, for example, as an example. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In one embodiment, the data processing apparatus 40 may further include an output device 405 and an input device 406. An output device 405 is in communication with the processor 401 and may display information in a variety of ways. For example, the output device 405 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 406 is in communication with the processor 401 and can accept user input in a variety of ways. For example, the input device 406 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
Those skilled in the art will appreciate that the configuration shown in fig. 11 does not constitute a limitation of the data processing apparatus 40 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be employed.
In addition, the present disclosure also provides a computer-readable storage medium including instructions, which when executed by a server, cause the server to perform the data processing method provided as the above embodiment.
In addition, the present disclosure also provides a computer program product including instructions that, when executed by a server, cause the server to perform the data processing method provided as the above embodiment.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
Claims (10)
1. A data processing method, comprising:
receiving a data modification request message, wherein the data modification request message comprises an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used for modifying data corresponding to the account to be modified;
determining a process to be confirmed based on the identification of the account to be modified, wherein the process to be confirmed is a process corresponding to the account to be modified;
and when the process to be confirmed is different from the target process, calling the target service in the target process so as to modify the data corresponding to the account to be modified.
2. The data processing method of claim 1, wherein determining a process to be validated based on the identity of the account to be modified comprises:
carrying out hash transformation on the identification of the account to be modified to obtain a target hash value;
and determining the process to be confirmed based on the target hash value.
3. The data processing method of claim 1, wherein the data modification request message further includes an identification of a first thread, the first thread being a thread corresponding to the target service;
the invoking the target service in the target process includes:
invoking the target service in the first thread of the target process.
4. The data processing method of claim 2, wherein the method further comprises:
determining a second thread based on the target hash value, wherein the second thread is a thread corresponding to the account to be modified;
and adding the target hash value to a target queue, wherein the target queue is a queue corresponding to the second thread.
5. The data processing method of claim 4, wherein the method further comprises:
when first receiving time is before second receiving time, preferentially acquiring a first hash value and preferentially processing a first data modification request message, wherein the first hash value is one of M hash values included in the target queue, the first data modification request message is a data modification request message corresponding to the first hash value, the first receiving time is the receiving time of the first data modification request message, the second receiving time is the receiving time of a second modification request message, the second data modification request message is a data modification request message corresponding to a second hash value, the second hash value is a hash value of the M hash values except the first hash value, and M is greater than or equal to 1;
and after a preset time interval, acquiring the second hash value and processing the second data modification request message.
6. The data processing method of claim 4, wherein the target queue is a non-blocking queue.
7. A data processing apparatus, comprising: the device comprises a receiving module, a determining module and a processing module;
the receiving module is configured to receive a data modification request message, where the data modification request message includes an identifier of an account to be modified and an identifier of a target process, the target process is a process corresponding to a target service, and the target service is used to modify data corresponding to the account to be modified;
the determining module is configured to determine a process to be confirmed based on the identifier of the account to be modified, where the process to be confirmed is a process corresponding to the account to be modified;
the processing module is configured to, when the process to be confirmed is different from the target process, invoke the target service in the target process to modify data corresponding to the account to be modified.
8. A server, characterized in that the server comprises:
a processor;
a memory configured to store the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of any one of claims 1-6.
9. A computer-readable storage medium having instructions stored thereon, wherein the instructions in the computer-readable storage medium, when executed by a server, enable the server to perform the data processing method of any one of claims 1-6.
10. A computer program product, characterized in that it comprises computer instructions which, when run on a server, cause the server to carry out the data processing method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111358141.7A CN114168233B (en) | 2021-11-16 | 2021-11-16 | Data processing method, device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111358141.7A CN114168233B (en) | 2021-11-16 | 2021-11-16 | Data processing method, device, server and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114168233A true CN114168233A (en) | 2022-03-11 |
CN114168233B CN114168233B (en) | 2022-12-27 |
Family
ID=80479315
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111358141.7A Active CN114168233B (en) | 2021-11-16 | 2021-11-16 | Data processing method, device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114168233B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160188426A1 (en) * | 2014-12-31 | 2016-06-30 | International Business Machines Corporation | Scalable distributed data store |
CN105827604A (en) * | 2016-03-15 | 2016-08-03 | 深圳市游科互动科技有限公司 | Server and service processing method thereof |
CN110795171A (en) * | 2019-09-18 | 2020-02-14 | 平安银行股份有限公司 | Service data processing method and device, computer equipment and storage medium |
CN111813805A (en) * | 2019-04-12 | 2020-10-23 | 中国移动通信集团河南有限公司 | Data processing method and device |
CN113094430A (en) * | 2021-03-25 | 2021-07-09 | 北京达佳互联信息技术有限公司 | Data processing method, device, equipment and storage medium |
-
2021
- 2021-11-16 CN CN202111358141.7A patent/CN114168233B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160188426A1 (en) * | 2014-12-31 | 2016-06-30 | International Business Machines Corporation | Scalable distributed data store |
CN105827604A (en) * | 2016-03-15 | 2016-08-03 | 深圳市游科互动科技有限公司 | Server and service processing method thereof |
CN111813805A (en) * | 2019-04-12 | 2020-10-23 | 中国移动通信集团河南有限公司 | Data processing method and device |
CN110795171A (en) * | 2019-09-18 | 2020-02-14 | 平安银行股份有限公司 | Service data processing method and device, computer equipment and storage medium |
CN113094430A (en) * | 2021-03-25 | 2021-07-09 | 北京达佳互联信息技术有限公司 | Data processing method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
李丽娜等: "流数据处理中负载突发感知的弹性资源分配", 《计算机学报》 * |
Also Published As
Publication number | Publication date |
---|---|
CN114168233B (en) | 2022-12-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9501319B2 (en) | Method and apparatus for scheduling blocking tasks | |
US10701139B2 (en) | Life cycle management method and apparatus | |
CN107241281B (en) | Data processing method and device | |
CN111542064B (en) | Container arrangement management system and arrangement method for wireless access network | |
WO2019001074A1 (en) | Remote process calling method and apparatus, and computer device | |
US20220357990A1 (en) | Method for allocating data processing tasks, electronic device, and storage medium | |
CN110166507B (en) | Multi-resource scheduling method and device | |
CN105516086B (en) | Method for processing business and device | |
CN106897299B (en) | Database access method and device | |
US11868164B2 (en) | On-demand code execution with limited memory footprint | |
JP2024512209A (en) | Information processing method based on IoT devices, related devices and storage media | |
US20240086228A1 (en) | Resource Configuration Method and Apparatus, Electronic Device, and Computer-Readable Storage Medium | |
CN111163140A (en) | Method, apparatus and computer readable storage medium for resource acquisition and allocation | |
CN111586140A (en) | Data interaction method and server | |
CN111200606A (en) | Deep learning model task processing method, system, server and storage medium | |
CN114979286B (en) | Access control method, device, equipment and computer storage medium for container service | |
CN112104679B (en) | Method, apparatus, device and medium for processing hypertext transfer protocol request | |
CN115168040A (en) | Job preemption scheduling method, device, equipment and storage medium | |
WO2022257247A1 (en) | Data processing method and apparatus, and computer-readable storage medium | |
CN111290842A (en) | Task execution method and device | |
CN117056041A (en) | Fine granularity resource pool scheduling method and system for GPU remote call | |
CN114168233B (en) | Data processing method, device, server and storage medium | |
CN110245027B (en) | Inter-process communication method and device | |
CN113612643B (en) | Network configuration method, device and equipment of cloud mobile phone and storage medium | |
WO2024130565A1 (en) | Task processing method and apparatus, and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |