CN108268490B - Numerical value updating method and device and server - Google Patents

Numerical value updating method and device and server Download PDF

Info

Publication number
CN108268490B
CN108268490B CN201611259773.7A CN201611259773A CN108268490B CN 108268490 B CN108268490 B CN 108268490B CN 201611259773 A CN201611259773 A CN 201611259773A CN 108268490 B CN108268490 B CN 108268490B
Authority
CN
China
Prior art keywords
data block
update
value
lock
updating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611259773.7A
Other languages
Chinese (zh)
Other versions
CN108268490A (en
Inventor
邱雷
黄海燕
朱金伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201611259773.7A priority Critical patent/CN108268490B/en
Publication of CN108268490A publication Critical patent/CN108268490A/en
Application granted granted Critical
Publication of CN108268490B publication Critical patent/CN108268490B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • G06F16/24578Query processing with adaptation to user needs using ranking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps

Abstract

The invention discloses a numerical updating method, a numerical updating device and a server, and belongs to the technical field of data processing. The method comprises the following steps: obtaining at least two first update instructions, wherein each first update instruction corresponds to a lock, the lock is used for locking a data block updated by the update instruction corresponding to the lock when the first update instruction corresponding to the lock is executed, the first update instruction is used for indicating to update a numerical value of a field, the numerical value of the field is stored in n data blocks, the sum of the numerical values corresponding to the fields stored in the n data blocks is the numerical value of the field, and n is an integer greater than 1; and executing the acquired at least two first updating instructions in parallel to update at least two data blocks in the n data blocks. The problem that the processing speed of the update instruction is low due to the processing mode of the update instruction provided in the related technology is solved, and the effect of improving the processing speed of the update instruction is achieved.

Description

Numerical value updating method and device and server
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a numerical update method, a numerical update device, and a server.
Background
A multi-user database system is a database system that allows multiple users to use the same database at the same time, such as an airline reservation database system, a voting database system, a Racket database system, and so forth. There may be fields in the multi-user database system for instantaneous large-scale concurrent update (for example, a field for storing the remaining number of airline tickets, a field for storing the number of votes, and a field for storing the remaining number of robbery goods), and a server in which the multi-user database system is installed needs to update the value of the field.
In the related art, when a server updates a value of a field according to any update instruction, the server will prevent other instructions from being executed on the field, so that the processing speed of the update instruction is slow due to the processing mode of the update instruction provided in the related art, and the processing requirement of the server in a scene of instantaneously and massively and concurrently updating a field cannot be met.
Disclosure of Invention
In order to solve the problem that the processing speed of an update instruction is low due to the processing mode of the update instruction provided in the prior art, the embodiment of the invention provides a numerical value updating method, a numerical value updating device and a server. The technical scheme is as follows:
in a first aspect, a numerical update method is provided, where the method includes: the method comprises the steps that at least two first updating instructions are obtained, each first updating instruction corresponds to a lock, the lock is used for locking a data block updated by the corresponding updating instruction of the lock when the first updating instruction corresponding to the lock is executed, the first updating instruction is used for indicating to update a numerical value of a field, the numerical value of the field is stored in n data blocks, the sum of the numerical values corresponding to the field stored in the n data blocks is the numerical value of the field, and n is an integer larger than 1; and executing the acquired at least two first updating instructions in parallel to update at least two data blocks in the n data blocks.
The method comprises the steps of splitting a field value into n values, storing each value of the n values into 1 data block independently, which is equivalent to changing one value into a plurality of independent values to be processed, obtaining at least two first updating instructions, and executing the obtained at least two first updating instructions in parallel to update at least two data blocks because a lock corresponding to each first updating instruction can lock the data blocks updated by the first updating instruction. Because at least two first update instructions are executed in parallel in the field value updating process, namely the server can process n update instructions at the same time, the problem of low update instruction processing speed caused by the update instruction processing mode provided in the related technology is solved, and the effect of improving the update instruction processing speed is achieved.
In a first possible implementation manner, the n data blocks include a reserved data block and n-1 updated data blocks, and the initial value corresponding to the field stored in the reserved data block is greater than 0.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the method further includes, in a case that a value corresponding to the field stored in the reserved data block is higher than a first threshold, transferring a part of the value from the reserved data block to a first update data block, where the first update data block is an update data block in which the value corresponding to the field stored in the first update data block is updated to be lower than a second threshold, and the part of the values is a value greater than 0.
When the value corresponding to the field stored in any update data block is updated to be lower than the second threshold value, transferring partial value from the reserved data block to the update data block, so that the value corresponding to the field stored in the update data block is not updated to 0, and the server can continue to process n-1 update instructions in parallel.
With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a third possible implementation manner, the method further includes: receiving a second updating instruction, and generating a lock corresponding to the second updating instruction, wherein the second updating instruction is used for indicating to update the numerical value of the field; under the condition that the value corresponding to the field stored in the reserved data block is higher than a first threshold value, adding a lock corresponding to a second updating instruction into a lock queue of a second updating data block, wherein the second updating data block is an updating data block with the least number of unexecuted updating instructions; and under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value, adding a lock corresponding to the second updating instruction into a lock queue of the reserved data block.
And adding a lock corresponding to the second updating instruction to a lock queue of one updating data block with the least number of the unexecuted updating instructions to allocate the second updating instruction to the one updating data block with the least number of the unexecuted updating instructions, so that the number of the unexecuted updating instructions in each updating data block is equivalent.
With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a fourth possible implementation manner, the method further includes, when a value corresponding to the field stored in the reserved data block is lower than a first threshold, transferring all values corresponding to the field stored in the third update data block to the reserved data block; migrating a lock in the lock queue of the third update data block to a lock queue of a reserved data block; the third updating data block is all or part of the n-1 updating data blocks.
Under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value, after the server transfers the value corresponding to the field stored in each updating data block to the reserved data block, the value corresponding to the field stored in each updating data block should be 0, and then the server can only update the value corresponding to the field stored in the reserved data block according to the updating instruction and serially process the updating instruction. Since the value stored in the reserved data block corresponding to the field is below the first threshold, indicating that the number of update instructions that can execute with the value of the field is limited, the manner in which the update instructions are serially processed does not result in too slow a processing speed of the remaining update instructions. In addition, the occupation of the thread corresponding to the third updating data block on the processor can be reduced.
When the value corresponding to the field stored in the reserved data block is lower than the first threshold value, and the third update data block is a partial update data block in the n-1 update data blocks, the locks in the lock queues of the third update data blocks are migrated into the lock queues of the reserved data blocks, and the value corresponding to the field stored in the third update data blocks is completely transferred into the reserved data blocks, so that the occupation of the threads of the partial update data blocks on the processor can be reduced, other update data blocks in the n-1 update data blocks are updated in parallel, and the processing speed of the remaining unprocessed update instructions can be ensured.
With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a fifth possible implementation manner, the method further includes, when the value corresponding to the field stored in the reserved data block is lower than the first threshold value and the value corresponding to the field stored in any or part of the update data blocks is updated to be lower than the second threshold value, transferring the value corresponding to the field stored in the update data blocks to the reserved data blocks, and migrating locks in the lock queues of the update data blocks to the lock queue of the reserved data blocks.
With reference to the first possible implementation manner of the first aspect or the second possible implementation manner of the first aspect, in a sixth possible implementation manner, the method further includes migrating a lock in a lock queue of a fourth update data block to the lock queue of the reserved data block when a value corresponding to the field stored in the reserved data block is lower than a first threshold, where the fourth update data block is an update data block in which the stored value corresponding to the field is updated to 0.
When the server updates the value corresponding to the field stored in any update data block to 0, the server migrates the lock of the unprocessed update instruction in the update data block to the lock queue of the reserved data block, that is, allocates the unprocessed update instruction in the update data block to the reserved data block, so that the update instructions processed in each update data block are as many as possible, and the speed of processing the update instruction by the server is maximized. In addition, the lock of the update instruction which cannot be processed in each update data block is migrated to the reserved data block, so that the server can execute the update instruction which is not processed in the update data blocks to update the value corresponding to the field stored in the reserved data block.
With reference to the first aspect, in a seventh possible implementation manner, the n data blocks are all update data blocks, and the method further includes: receiving a third updating instruction, and generating a lock corresponding to the third updating instruction, wherein the third updating instruction is used for indicating to increase the numerical value of the field; and adding the lock corresponding to the third updating instruction to the lock queue of the data block with the least number of the non-executed updating instructions.
And adding a lock corresponding to the third updating instruction to a lock queue of a data block of the least number of the unexecuted updating instructions to allocate the third updating instruction to the data block of the least number of the unexecuted updating instructions, so that the unprocessed updating instructions in the data blocks are equivalent.
With reference to the first aspect and the first to seventh possible implementation manners of the first aspect, the obtaining at least two first update instructions includes: for each data block in the n data blocks, locking each data block by using a lock at the head of a lock queue of each data block; and respectively obtaining the updating instructions corresponding to the locks at the head of the lock queue of each data block to obtain at least two first updating instructions.
In a second aspect, a numerical update apparatus is provided, which includes at least one execution unit, where the execution unit is configured to implement corresponding steps in the numerical update method of the first aspect.
In a possible implementation manner, the execution unit is configured to obtain at least two first update instructions, where each first update instruction corresponds to a lock, the lock is configured to lock a data block updated by the update instruction corresponding to the lock when the first update instruction corresponding to the lock is executed, the first update instruction is configured to instruct to update a value of a field, the value of the field is stored in n data blocks, a sum of values corresponding to the field stored in the n data blocks is the value of the field, and n is an integer greater than 1; the execution unit is further configured to execute the acquired at least two first update instructions in parallel to update at least two data blocks of the n data blocks.
Since the value of one field is divided into n values, and each value of the n values is stored into 1 data block independently, which is equivalent to changing one value into a plurality of independent values to be processed, at least two first update instructions are obtained, and since the lock corresponding to each first update instruction can lock the data block updated by the first update instruction, the obtained at least two first update instructions are executed in parallel, and at least two data blocks can be updated. Because at least two first update instructions are executed in parallel in the field value updating process, namely the server can process n update instructions at the same time, the problem of low update instruction processing speed caused by the update instruction processing mode provided in the related technology is solved, and the effect of improving the update instruction processing speed is achieved.
In a third aspect, a server is provided, which includes: the server is used for realizing the corresponding steps in the numerical value updating method of the first aspect.
In a fourth aspect, there is provided a computer-readable medium storing instructions for implementing the numerical update method of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of a server according to an exemplary embodiment of the present invention;
FIG. 2 is a flow chart of a method of updating values provided in one embodiment of the present invention;
FIG. 3 is a schematic diagram of a lock queue for data blocks provided in one embodiment of the invention;
FIG. 4 is a flow chart of a method of updating values provided in another embodiment of the present invention;
FIG. 5 is a diagram of a lock queue for each update block and reserve block of data according to another embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
The update block referred to herein is the same concept as a bucket (english: bucket) known to database technicians.
Referring to fig. 1, a schematic structural diagram of a server according to an exemplary embodiment of the present invention is shown. The server includes: a processor 11, a network interface 12 and a memory 13.
The processor 11 includes one or more processing cores, and the processor 11 executes various functional applications and data processing by executing software programs and modules. When the server processes the update instruction in parallel with multiple threads, these threads alternately occupy the processor 11.
The network interface 12 may be plural, with a portion of the network interface 12 being used for communication with the host.
The memory 13 is connected to the processor 11, for example, the memory 13 may be connected to the processor 11 through a bus; the memory 13 may be used to store software programs and modules.
The memory 13 may store an application module 14 and at least n data blocks required for at least one function, and the execution unit in the application module 14 may execute the corresponding steps in fig. 2 and 4 by executing the codes stored in the memory 13, specifically referring to the description of fig. 2 and 4.
The memory 13 may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as a Static Random Access Memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.
Those skilled in the art will appreciate that the configuration of the server shown in FIG. 1 does not constitute a limitation of the server and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
Fig. 2 is a flowchart illustrating a method for updating a value according to an embodiment of the present invention, where the method is mainly applied to a server for example. The numerical value updating method may include:
step 201, obtaining an initial value of a field to be updated, and storing n values obtained by splitting the initial value into n data blocks respectively.
The field to be updated is an integer field, and n is an integer greater than 1. Alternatively, the field may be a field in the server database where there is a possibility of instantaneous large-scale concurrent update. Such as a field for recording the number of votes obtained by the user a in the voting database system of the server, and a field for recording the remaining amount of inventory of the article B in the snapshot database system of the server.
The server obtains the initial value of the field, splits the initial value into n values, and stores each split value into a data block separately. The server splits the initial value into n values, which can be realized in various ways, and this embodiment is not described any more, and the n values are all natural numbers, and n can be set by a system developer or can be defined by a user.
In this embodiment, for a field used for storing the remaining number of the preemptive shoot object in the preemptive shoot scene, the server may obtain the remaining number of the preemptive shoot object as an initial value of the field. The server splits the initial value into n values, of which at least two values are different from 0.
In the case where two values having a large difference exist among the n values, since the processing speed of each update instruction is close, the speed at which the data block storing the smaller value is updated to 0 is faster. And when the value corresponding to the field stored in the data block is updated to 0, the server does not update the value corresponding to the field stored in the data block according to any updating instruction. Thereafter, the number of update instructions that the server can process in parallel decreases, and the speed of processing the update instructions slows down.
Optionally, a difference between any two of the n values is smaller than a predetermined threshold. Specifically, the predetermined threshold is 2 for example, the server calculates a quotient a and a remainder b obtained by dividing an initial numerical value of a field to be updated by n, assigns a numerical value a +1 to b data blocks, and assigns a numerical value a to the remaining n-b data blocks. Because the difference value of the numerical values corresponding to the fields stored in any two data blocks is small, the speed of updating the data blocks to 0 is equivalent, and therefore the server can continuously process the updating instruction at the fastest processing speed.
Taking this field as an example for recording the stock remaining quantity of the product B, and n is 10, the server obtains that the stock remaining quantity of the product B is 2999, and divides 10 by the stock remaining quantity 2999 to obtain a quotient 299 and a remainder 9. The server splits the value 2999 into 9 values 300 and 1 value 299, stores the value 300 in 9 data blocks, and stores the value 299 in 1 data block.
The server has previously created a lock queue for each of the n data blocks separately. And after the server splits the initial numerical value to obtain n numerical values, adding the same lock at the head of the lock queue of each data block.
It should be noted that, for each data block, in the case that the data block is not locked by any lock, the server may lock the data block by using the lock at the head of the lock queue of the data block.
After the n data blocks are all locked by the same lock, the server stores the n values into the n data blocks respectively, releases the lock on the n data blocks and deletes one lock from the head of the lock queue of each data block.
In this embodiment, for a field for storing the number of votes in the voting scene, the server takes the obtained number of votes as an initial value of the field. Typically, the initial value of this field is the initial value of 0 for the number of votes. When the initial value is 0, the server splits the initial value into n values 0.
Optionally, when the initial value of the field to be updated obtained by the server is 0, the value 0 is directly stored in the n data blocks. Taking this field as an example for recording the number of votes obtained by the user a and n is 10, when the voting channel is opened, the initial value of this field acquired by the server should be 0. The server stores the value 0 in 10 data blocks.
Step 202, receiving a third update instruction, generating a lock corresponding to the third update instruction, and adding the lock corresponding to the third update instruction to a lock queue of any one of the n data blocks.
And each time the server receives a third updating instruction, the server generates a lock corresponding to the third updating instruction, and adds the lock to the tail of a lock queue of a certain data block so as to achieve the purpose of distributing the third updating instruction to the data block.
When the server generates the lock corresponding to the third update instruction, the server may establish a correspondence between the identifier of the lock and the identifier of the third update instruction by generating a lock, or may obtain the lock corresponding to the third update instruction by directly generating a lock by using the identifier of the third update instruction.
Optionally, each time the server acquires a third update instruction, the lock corresponding to the third update instruction is added to the lock queue of the data block that has not executed the update instruction least among the n data blocks, so as to allocate the third update instruction to the data block that has not executed the update instruction least, so that the number of the update instructions that have not been executed in each data block is equivalent.
Specifically, the server creates a sorting array for determining the queue length of the lock queues of the n data blocks in advance, determines the lock queue with the shortest queue length from the lock queues of the n data blocks by using the sorting array, and adds the lock corresponding to the third update instruction to the tail of the lock queue with the shortest queue length. And the data block corresponding to the lock queue with the shortest queue length is the data block with the fewest unexecuted updating instructions in the n data blocks.
The number of lock queues with the shortest queue length determined by the server from the lock queues of the n data blocks may be one or multiple. If the number of the lock queues with the shortest queue length is determined to be multiple, the server can randomly select one lock queue from the multiple lock queues, and add the lock corresponding to the third updating instruction to the tail of the selected lock queue.
For example, as shown in fig. 3, when the server receives a third update instruction for indicating that the ticket number of the user a is updated, the server determines that the lock queue length of the data block 32 is the shortest by using the sorting array 31. The server adds the lock 33 corresponding to the third update instruction to the tail of the lock queue of the data block 32.
Wherein the third update instruction is to indicate to update the value of the field. Optionally, a third update instruction is used to instruct to increase the value of the field. Optionally, a third update instruction is used to instruct to lower the value of the field.
Step 203, for each data block in the n data blocks, locking the data block by using the lock at the head of the lock queue of each data block, and respectively obtaining the update instruction corresponding to the lock at the head of the lock queue of each data block to obtain at least two first update instructions.
For each data block, after the server locks the data block by using the lock at the head of the lock queue of the data block, an update instruction corresponding to the lock is obtained, and a first update instruction is obtained. Thereafter, the server may update the data block according to the first update instruction, release the lock on the data block, and delete the lock corresponding to the first update instruction from the head of the lock queue of the data block.
And step 204, executing the acquired at least two first updating instructions in parallel to update at least two data blocks in the n data blocks.
It should be noted that, the step numbers of step 202 to step 204 do not limit the execution order of the steps, and step 202 to step 204 may be executed in parallel.
In this embodiment, the server creates, for each data block, a thread for executing the update instruction corresponding to the data block separately in advance, and may execute, in parallel, the first update instruction corresponding to the lock at the head of each lock queue using n threads.
Optionally, the update instruction in this embodiment carries a value increment indicating the field update, where the value increment may be positive or negative. And when the server updates the data block according to the update instruction and stores the numerical value corresponding to the field, the server updates the data block by using the numerical value obtained by adding the numerical value increment to the numerical value corresponding to the field stored in the data block. And the server deletes the lock corresponding to the updating instruction from the head of the lock queue of the data block and releases the lock on the data block. And after that, the server continues to process the lock at the head of the lock queue and the update instruction corresponding to the lock by using the thread.
For example, still referring to FIG. 3, the server locks the data block 32 with thread 1 according to the lock 34 at the head of the lock queue of the data block 32, and the server obtains the first update instruction corresponding to the lock 34. If the first update instruction is used to instruct the server to subtract 1 from the value of the field, the server uses thread 1 to subtract 1 from the value corresponding to the field stored in the data block 32, and then releases the lock on the data block 32 and deletes the lock 34 from the head of the lock queue. Thereafter, the lock 35 is at the head of the lock queue for the data block 32. The server continues processing the lock 35 at the head of the lock queue and the update instruction corresponding to the lock 35 by using the thread 1.
It should be noted that the data blocks related to this embodiment are all buckets, and the sum of the values corresponding to the field stored in the n data blocks is the value of the field.
In summary, in the value updating method provided in the embodiment of the present invention, the value of one field is divided into n values, each of the n values is separately stored in 1 data block, which is equivalent to changing one value into a plurality of independent values to be processed, and at least two first update instructions are obtained. Because at least two first update instructions are executed in parallel in the field value updating process, namely the server can process n update instructions at the same time, the problem of low update instruction processing speed caused by the update instruction processing mode provided in the related technology is solved, and the effect of improving the update instruction processing speed is achieved.
And adding a lock corresponding to the third updating instruction to a lock queue of a data block of the least number of the unexecuted updating instructions to allocate the third updating instruction to the data block of the least number of the unexecuted updating instructions, so that the unprocessed updating instructions in the data blocks are equivalent.
In the snapshot scenario, the server can store the value of one field by using n-1 update data blocks and one reserved data, wherein the n-1 update data blocks are all used for processing update instructions. Since the execution speed of the update instructions in each update data block is not completely consistent, the reduction speed of each update data block is not completely the same. The server continuously transfers a part of the numerical value corresponding to the field stored in the reserved data block to the updated data block, so that the numerical value corresponding to the field stored in the updated data block is prevented from being updated to 0 too early, and the speed of processing the update instruction by the server is ensured to reach the highest speed.
Referring to fig. 4, a flowchart of a method for updating a value according to another embodiment of the present invention is shown, where the method is mainly applied to a server for illustration. The numerical value updating method may include:
step 401, obtaining an initial value of a field to be updated, storing a first value in a reserved data block, and storing n-1 values obtained by splitting a second value into n-1 updated data blocks, respectively, where the sum of the first value and the second value is the initial value of the field.
The field to be updated is an integer field, and n is an integer greater than 2. Alternatively, the field may be a field in the server database where there is a possibility of instantaneous large-scale concurrent update.
In this embodiment, the server stores the value of a field using one reserved block and n-1 updated blocks. Specifically, after the server obtains the initial value of the field, the same lock is added at the head of the lock queue of the reserved data block and the n-1 updated data blocks.
After the reserved data block and the n-1 updated data blocks are locked by the same lock, a first numerical value is stored in the reserved data block, and each numerical value in the n-1 numerical values obtained by splitting the second numerical value is separately stored in one updated data block.
Optionally, the server obtains a first value by rounding a value k obtained by multiplying the initial value by the reserved ratio, and obtains a second value by subtracting the first value from the initial value. Optionally, the server multiplies the initial value by the difference between 1 and the reserved ratio to obtain a value m, rounds the value m to obtain a second value, and subtracts the second value from the initial value to obtain the first value.
The retention ratio may be set by a system developer, and the specific value of the retention ratio is not limited in this embodiment. For example, the retention ratio may be any percentage in the range of 20% to 100%.
It should be noted that, when the value k is an integer, the server may not round it, and directly store it as the first value in the reserved data block; when the value m is an integer, the server may not round the value m, and directly takes the value m as a second value; the server can perform rounding on any numerical value in various ways, such as rounding up, rounding down, and the like, which is not described in detail in this embodiment.
Optionally, the syntax of the first value obtained by multiplying the initial value by the reserved ratio by the server in the database may be: safe _ value is value Safe _ percent. Wherein, value refers to an initial value of a field to be updated, Safe _ percent refers to a reserved ratio, and Safe _ value refers to a first value.
The server splits the second value into n-1 values, which can be implemented in various ways, and this embodiment is not described in detail any more, and the n-1 values are all natural numbers.
Optionally, the difference between the n-1 values is smaller than a predetermined threshold. Specifically, the server calculates a quotient c and a remainder d obtained by dividing the second numerical value by n-1, assigns the numerical value c +1 to d numerical values, and assigns the numerical value c to n-1-d numerical values to obtain n-1 numerical values.
Optionally, the syntax of the server splitting the second value into n-1 values in the database may be: d ═ value (1-safe _ percent) ]% bucket _ num; d packet _ values (1-safe _ percent)/packet _ num + 1; bucket _ num-d Bucket _ value (1-safe _ percent)/Bucket _ num. Wherein, the packet _ num is the number n-1 of the update data blocks, and the packet _ value is one of the n-1 numerical values.
And after the server stores the n-1 numerical values into the n-1 updating data blocks and stores the first numerical value into the reserved data block, releasing locks on the n-1 updating data blocks and the reserved data block and deleting a lock at the head of each of the n-1 updating data blocks and the reserved data block from the head of each of the n-1 updating data blocks and the reserved data block.
Taking this field as an example for recording the inventory remaining quantity of the product B, the reservation ratio being 80%, and n being 11, after the server acquires that the inventory remaining quantity of the product is 30000, the same lock is added to the head of the lock queue of the reserved data block and 10 update data blocks for storing the value of this field. After the reserved data blocks and the 10 updated data blocks are all locked by the same lock, the server multiplies the remaining quantity 30000 by the reserved proportion 80% to obtain a first numerical value 24000, and stores the first numerical value 24000 into the reserved data blocks. The server subtracts the first value 24000 from the remaining inventory quantity 30000 to obtain a second value 6000, and divides the second value into 10 values 600. After the server stores the value 600 in each of the 10 update blocks, the server releases the locks on the 10 update blocks and the reserved block and deletes the locks at the head of the lock queue of the 10 update blocks and the reserved block from the head of the queue.
Optionally, before the server obtains the initial value of the field to be updated, in the process of creating the database table by the server, the Structured Query Language (SQL) implementation syntax for specifying some attributes to the field may include: CREATE TABLE < TABLE _ name > (< column _ name > inside [ [ difference < DIVISION _ num > ] [ SAFE _ period < percentage > ] ] [ OFFSET _ RANGE < bottom _ num > TO < up _ num > ]) ]. Wherein, table _ name refers to a table name of a database table, column _ name refers to a column name (usually, the name of the field), DIVISION refers to the number of updated data blocks, DIVISION _ num is n-1, SAFE _ PERCENTER refers to a reserved proportion, percentage refers to a reserved proportion value, OFFSET _ RANGE refers to a value RANGE of a value increment, bottom _ num refers to a lower limit value of the value increment value RANGE, and up _ num refers to an upper limit value of the value increment value RANGE.
When the update instruction indicates that the updated value increment exceeds the value increment range, the server does not update the value stored in any data block according to the update instruction. The data block referred to herein includes a retention data block and an update data block.
Step 402, receiving a second update instruction, and generating a lock corresponding to the second update instruction, where the second update instruction is used to instruct to update the value of the field.
The generation of the lock corresponding to the second update instruction by the server may refer to a manner in which the server generates the lock corresponding to the third update instruction, which is specifically referred to the explanation in step 202, and details are not described here.
Step 403, in a case that the value corresponding to the field stored in the reserved data block is higher than the first threshold, adding the lock corresponding to the second update instruction to a lock queue of a second update data block, where the second update data block is an update data block with the least number of unexecuted update instructions in the n-1 update data blocks.
The first threshold may be a fixed value set by a system developer, or may also be a numerical value determined by the server according to a calculation policy preset by the system developer, and the first threshold is not specifically limited in this embodiment.
The server has previously created a lock queue for each update block individually and has previously created an ordering array for determining the queue length of the lock queue for n-1 update blocks. And when the server acquires a second updating instruction, generating a lock corresponding to the second updating instruction. The server can determine a lock queue with the shortest queue length from the lock queues of the n-1 update data blocks by using the sorting array, and add the lock corresponding to the second update instruction to the tail of one lock queue with the shortest queue length in the lock queues. And the update data block corresponding to the lock queue with the shortest queue length is the data block with the least unexecuted update instruction in the n-1 update data blocks.
Step 404, for each data block in the n data blocks, locking the data block by using the lock at the head of the lock queue of each data block, respectively obtaining the update instructions corresponding to the lock at the head of the lock queue of each data block, obtaining at least two first update instructions, and executing the obtained at least two first update instructions in parallel to update at least two data blocks in the n data blocks.
For the explanation of step 404, refer to the explanation of step 203 and step 204, which are not described herein.
It should be noted that, unlike step 203 and step 204, in this embodiment, the increment of the numerical value carried by most of the update instructions acquired by the server is negative.
Step 405, under the condition that the value corresponding to the field stored in the reserved data block is higher than the first threshold, transferring a part of the value from the reserved data block to a first updated data block, wherein the value corresponding to the field stored in the first updated data block is updated to an updated data block lower than the second threshold, and a part of the values is a value larger than 0.
The second threshold and a part of the numerical values may be fixed values set by a system developer, or may also be numerical values determined by the server according to a calculation policy preset by the system developer, and this embodiment does not specifically limit the second threshold and the part of the numerical values.
Under the condition that the value corresponding to the field stored in the reserved data block is higher than the first threshold value, the server only allocates the received second updating instruction to the updating data block, so that the server can update the value corresponding to the field stored in the n-1 updating data blocks in parallel according to the updating instruction allocated to the n-1 updating data blocks.
Since the numerical value increment carried by most of the updating instructions acquired by the server is negative, the numerical value corresponding to the field stored in each updating data block is continuously reduced in the process of updating the numerical value of the field by the server. When the value corresponding to the field stored in the update data block is updated to 0, the server cannot update the data block according to the update instruction carrying the negative increment. In order to ensure that the server can continue to process n-1 updating instructions in parallel, the server continuously gives a part of the value corresponding to the field stored in the reserved data block to the updating data block until the value corresponding to the field stored in the reserved data block is lower than the first threshold value.
Specifically, the server adds the same lock at the head of the lock queue for the first update data and the reserved data block when transferring a portion of the value from the reserved data block to the first update data block. After the first update data and the reserved data block are locked by the same lock, the server transfers a part of the value from the reserved data block to the update data block, releases the lock on the update data block and the reserved data block and deletes the lock at the head of the lock queue of the update data block and the reserved data.
For example, the first threshold is 1000, the second threshold is 100, and the partial value is 600, as shown in fig. 5, the value corresponding to the field stored in the update data block 51 is updated to be lower than 100, the value 600 is transferred from the reserved data block 52 to the update data block 51, the value corresponding to the field stored in the update data block 51 is 699, and the value corresponding to the field stored in the reserved data block is 23400 after the transfer.
Step 406, adding the lock corresponding to the second update instruction to the lock queue of the reserved data block when the value corresponding to the field stored in the reserved data block is lower than the first threshold.
And when the value stored correspondingly to the field in the reserved data block is transferred to be lower than the first threshold value, the server allocates all the acquired second updating instructions to the reserved data block and does not allocate any updating data block any more. That is, the server will add the lock corresponding to the second update instruction to the lock queue of the reserved data block, and will not add the lock corresponding to the second update instruction to any lock queue of the updated data block.
Step 407, under the condition that the value corresponding to the field stored in the retained data block is lower than the first threshold, transferring all the values corresponding to the field stored in the third updated data block to the retained data block, and migrating the lock in the lock queue of the third updated data block to the lock queue of the retained data block, where the third updated data block is all or part of the n-1 updated data blocks.
The server also creates a lock queue for the reserved data blocks separately in advance.
Optionally, the third update data block is all of the n-1 update data blocks.
After the server transfers the value corresponding to the field stored in each updated data block to the reserved data block, the value corresponding to the field stored in each updated data block should be 0, and the value of the field stored in the reserved data block is equal to the sum of the value corresponding to the field stored in each updated data block before transfer and the value corresponding to the field stored in the reserved data block before transfer.
After that, since the value corresponding to the field stored in each update data block is 0, the server can only update the value corresponding to the field stored in the reserved data block according to the update instruction. That is, the server can only process update instructions serially.
In case the value stored in the reserved data block corresponding to this field is below the first threshold, this indicates that the number of update instructions that can execute with the value of this field is limited, and the way in which the update instructions are processed serially does not result in too slow a processing speed of the remaining update instructions. In addition, the occupation of the processor by n-1 threads for updating the data block can be reduced.
Optionally, the third update data block is a partial update data block of the n-1 update data blocks. At this time, the occupation of the thread of the partial update data block on the processor can be reduced, and other update data blocks in the n-1 update data blocks are updated in parallel, so that the processing speed of the rest update instructions can also be ensured.
Optionally, step 407 may be replaced with: and under the condition that the value corresponding to the field stored in the reserved data block is lower than a first threshold value, when the value corresponding to the field stored in any or part of the update data blocks is updated to be lower than a second threshold value, transferring the value corresponding to the field stored in the update data blocks into the reserved data blocks, and migrating the locks in the lock queues of the update data blocks into the lock queues of the reserved data blocks.
Optionally, step 407 may also be replaced by: and under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value, migrating a lock in the lock queue of the fourth updating data block to the lock queue of the reserved data block, wherein the fourth updating data block is the stored updating data block of which the value corresponding to the field is updated to 0.
And for each update data block, the server updates the value corresponding to the field stored in the data block according to the update instruction distributed to the update data block until the value corresponding to the field stored in the data block is updated to 0.
When the server updates the value corresponding to the field stored in any update data block to 0, the server migrates the lock of the unprocessed update instruction corresponding to the update data block to the lock queue of the reserved data block, so that each update data block can process as many update instructions as possible, and the server can execute the unprocessed update instruction in the update data blocks to update the value corresponding to the field stored in the update reserved data block.
It should be noted that, in this embodiment, the step numbers of steps 402 to 405 do not limit the execution order of these steps, and steps 402 to 405 may be executed in parallel. The step numbers in step 402, step 403, step 404, step 406 and step 407 do not limit the execution order of these steps, and step 402, step 403, step 404, step 406 and step 407 may be executed in parallel.
In summary, in the value updating method provided in the embodiment of the present invention, the value of one field is split into n values, each of the n values is separately stored in 1 data block, which is equivalent to changing one value into a plurality of independent values to be processed, and at least two first update instructions are obtained. Because at least two first updating instructions can be executed in parallel in the field numerical value updating process, the server can process n updating instructions at the same time, the problem that the updating instruction processing speed is low due to the updating instruction processing mode provided in the related technology is solved, and the effect of improving the updating instruction processing speed is achieved.
And adding a lock corresponding to the second updating instruction to a lock queue of one updating data block with the least number of the unexecuted updating instructions to allocate the second updating instruction to the one updating data block with the least number of the unexecuted updating instructions, so that the number of the unexecuted updating instructions in each updating data block is equivalent.
When the server updates to 0 through the value corresponding to the field stored in any update data block, the server migrates the lock of the unprocessed update instruction in the update data block to the lock queue of the reserved data block, that is, allocates the unprocessed update instruction in the update data block to the reserved data block, so that the update instructions processed in each update data block are as many as possible, and the speed of processing the update instruction by the server is maximized. In addition, the lock of the update instruction which cannot be processed in each update data block is migrated to the reserved data block, so that the server can execute the update instruction which is not processed in the update data blocks to update the value corresponding to the field stored in the reserved data block.
When the server updates the value of the field stored in the data block according to the update instruction, the update statement used may be: UPDATE < table _ name > SET < column _ name > < value > OFFSET, which is the value increment indicating an UPDATE in the UPDATE instruction. That is, the server sums the value corresponding to the field stored before the update of the data block with < value > OFFSET, and the result of the summation is the value corresponding to the field stored after the update of the data block, so that the update statement is simple.
Optionally, when the server needs to delete the value of one field, the server adds the same lock at the head of the lock queue of n data blocks in the field. After the n data blocks are locked by the same lock, deleting the value corresponding to the field stored in each data block, releasing the lock on each data block and deleting the lock at the head of the lock queue of the n data blocks.
Optionally, the server calculates a sum of values of the field to be corrected, which are stored in the n data blocks, every predetermined time, and determines the calculated sum of the values as the value of the field. Wherein the predetermined time is set by a system developer.
According to the value updating method provided by the invention, the processing speed of the updating instruction for instructing the server to update the value of a certain field is improved. When the server calculates the value of the field, the server cannot update the value corresponding to the field stored in any data block according to any update instruction. In order to ensure that the server processes the updating instruction at high speed, the server only calculates the numerical value of the field once every preset time, and real-time updating of the numerical value of the field is not ensured.
One embodiment of the present invention provides a numerical value updating apparatus that may be implemented as all or a portion of a server, either by software, hardware, or a combination of both. The value updating apparatus includes an execution unit operable to implement the functions of any one of the steps shown in the present invention.
The execution unit is configured to obtain at least two first update instructions, each first update instruction corresponds to a lock, the lock is configured to lock a data block updated by the update instruction corresponding to the lock when the first update instruction corresponding to the lock is executed, the first update instruction is configured to instruct to update a value of a field, the value of the field is stored in n data blocks, a sum of values corresponding to the field stored in the n data blocks is the value of the field, and n is an integer greater than 1.
In a possible implementation manner, the execution unit is further configured to execute the acquired at least two first update instructions in parallel to update at least two data blocks of the n data blocks.
The execution unit is further configured to, when the value corresponding to the field stored in the reserved data block is higher than the first threshold, transfer a part of the value from the reserved data block to the first updated data block, where the first updated data block is an updated data block in which the value corresponding to the field stored in the first updated data block is updated to a value lower than the second threshold, and a part of the values is a value greater than 0.
In a possible implementation manner, the execution unit is further configured to: receiving a second updating instruction, and generating a lock corresponding to the second updating instruction, wherein the second updating instruction is used for indicating to update the numerical value of the field; under the condition that the value corresponding to the field stored in the reserved data block is higher than a first threshold value, adding a lock corresponding to a second updating instruction into a lock queue of a second updating data block, wherein the second updating data block is an updating data block with the least number of unexecuted updating instructions; and under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value, adding a lock corresponding to the second updating instruction into a lock queue of the reserved data block.
In a possible implementation manner, the execution unit is further configured to: under the condition that the value corresponding to the field stored in the reserved data block is lower than a first threshold value, transferring all the values corresponding to the field stored in the third updating data block to the reserved data block; migrating a lock in the lock queue of the third update data block to a lock queue of a reserved data block; the third updating data block is all or part of the n-1 updating data blocks.
In a possible implementation manner, the execution unit is further configured to: and under the condition that the value corresponding to the field stored in the reserved data block is lower than a first threshold value, when the value corresponding to the field stored in any or part of the update data blocks is updated to be lower than a second threshold value, transferring the value corresponding to the field stored in the update data blocks into the reserved data blocks, and migrating the locks in the lock queues of the update data blocks into the lock queues of the reserved data blocks.
In a possible implementation manner, the execution unit is further configured to: and under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value, migrating a lock in the lock queue of the fourth updating data block to the lock queue of the reserved data block, wherein the fourth updating data block is the stored updating data block of which the value corresponding to the field is updated to 0.
In a possible implementation manner, the execution unit is further configured to: receiving a third updating instruction, and generating a lock corresponding to the third updating instruction, wherein the third updating instruction is used for indicating to increase the numerical value of the field; and adding the lock corresponding to the third updating instruction to the lock queue of the data block with the least number of the non-executed updating instructions.
Reference may be made in connection with the above-described method embodiments.
Optionally, in this embodiment of the present invention, the execution unit may be implemented by a server shown in fig. 1.
It should be noted that: in the above embodiment, when updating the value of the field, the numerical value updating apparatus is exemplified by only the division of the functional modules, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the server is divided into different functional modules to complete all or part of the functions described above. In addition, the numerical value updating apparatus and the numerical value updating method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as a memory, is also provided that includes instructions executable by a wake-up receiver and a main transceiver of a second node to perform a method of transmitting a first frame after the node wakes up. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. The terms "first update command," "second update command," and "third update command" as used in the description and claims of the present patent application are all update commands, and the terms "first," "second," "third," and the like do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. Also, the use of the terms "a" or "an" and the like do not denote a limitation of quantity, but rather denote the presence of at least one.
It should be understood that, as used herein, the singular forms "a," "an," "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (15)

1. A method for updating a value, the method comprising:
for each data block in the n data blocks, locking the data block by using a lock at the head of a lock queue of the data block;
respectively obtaining update instructions corresponding to locks at the head of a lock queue of each data block to obtain at least two first update instructions, where the locks are used to lock the data blocks updated by the update instructions corresponding to the locks when the first update instructions corresponding to the locks are executed, the first update instructions are used to indicate to update the value of a field, the value of the field is stored in the n data blocks, the sum of the values corresponding to the fields stored in the n data blocks is the value of the field, n is an integer greater than 1, the first update instructions carry a value increment indicating the field update, and the value increment is positive or negative;
and executing the acquired at least two first updating instructions in parallel to update at least two data blocks in the n data blocks.
2. The method of claim 1, wherein the n data blocks include a reserved data block and n-1 updated data blocks, and wherein the initial value corresponding to the field stored in the reserved data block is greater than 0.
3. The method of claim 2, further comprising:
and under the condition that the value corresponding to the field stored in the reserved data block is higher than a first threshold value, transferring a part of the value from the reserved data block to a first updating data block, wherein the first updating data block is an updating data block in which the value corresponding to the stored field is updated to be lower than a second threshold value, and the part of the value is a value larger than 0.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
receiving a second updating instruction, and generating a lock corresponding to the second updating instruction, wherein the second updating instruction is used for indicating to update the numerical value of the field;
adding a lock corresponding to the second update instruction to a lock queue of the second update data block when the value corresponding to the field stored in the reserved data block is higher than a first threshold value, wherein the second update data block is one update data block of the n-1 update data blocks, and the number of the update instructions not executed is the least;
and adding a lock corresponding to the second updating instruction to a lock queue of the reserved data block under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value.
5. A method according to claim 2 or 3, characterized in that the method further comprises:
under the condition that the value corresponding to the field stored in the reserved data block is lower than a first threshold value, transferring all the values corresponding to the field stored in a third updating data block to the reserved data block;
migrating a lock in the lock queue of the third update data block to the lock queue of the reserved data block;
wherein the third update data block is all or part of the n-1 update data blocks.
6. A method according to claim 2 or 3, characterized in that the method further comprises:
and under the condition that the value corresponding to the field stored in the reserved data block is lower than a first threshold value, migrating a lock in a lock queue of a fourth updating data block into the lock queue of the reserved data block, wherein the fourth updating data block is an updating data block of which the value corresponding to the stored field is updated to 0.
7. The method of claim 1, wherein the n data blocks are all update data blocks, the method further comprising:
receiving a third updating instruction, and generating a lock corresponding to the third updating instruction, wherein the third updating instruction is used for indicating to increase the numerical value of the field;
and adding a lock corresponding to the third updating instruction to a lock queue of a data block with least unexecuted updating instruction.
8. A numerical value updating apparatus, characterized in that the apparatus comprises:
the execution unit is used for locking each data block in the n data blocks by using the lock at the head of the lock queue of each data block; respectively obtaining update instructions corresponding to locks at the head of a lock queue of each data block to obtain at least two first update instructions, where the locks are used to lock the data blocks updated by the update instructions corresponding to the locks when the first update instructions corresponding to the locks are executed, the first update instructions are used to indicate to update the value of a field, the value of the field is stored in the n data blocks, the sum of the values corresponding to the fields stored in the n data blocks is the value of the field, n is an integer greater than 1, the first update instructions carry a value increment indicating the field update, and the value increment is positive or negative;
the execution unit is further configured to execute the obtained at least two first update instructions in parallel to update at least two data blocks of the n data blocks.
9. The apparatus of claim 8, wherein the n data blocks include a reserved data block and n-1 updated data blocks, and wherein the initial value corresponding to the field stored in the reserved data block is greater than 0.
10. The apparatus of claim 9, wherein the execution unit is further configured to: and under the condition that the value corresponding to the field stored in the reserved data block is higher than a first threshold value, transferring a part of the value from the reserved data block to a first updating data block, wherein the first updating data block is an updating data block in which the value corresponding to the stored field is updated to be lower than a second threshold value, and the part of the value is a value larger than 0.
11. The apparatus according to claim 9 or 10, wherein the execution unit is further configured to:
receiving a second updating instruction, and generating a lock corresponding to the second updating instruction, wherein the second updating instruction is used for indicating to update the numerical value of the field;
adding a lock corresponding to the second update instruction to a lock queue of the second update data block when the value corresponding to the field stored in the reserved data block is higher than a first threshold value, wherein the second update data block is one update data block of the n-1 update data blocks, and the number of the update instructions not executed is the least;
and adding a lock corresponding to the second updating instruction to a lock queue of the reserved data block under the condition that the value corresponding to the field stored in the reserved data block is lower than the first threshold value.
12. The apparatus according to claim 9 or 10, wherein the execution unit is further configured to:
under the condition that the value corresponding to the field stored in the reserved data block is lower than a first threshold value, transferring all the values corresponding to the field stored in a third updating data block to the reserved data block;
migrating a lock in the lock queue of the third update data block to the lock queue of the reserved data block;
wherein the third update data block is all or part of the n-1 update data blocks.
13. The apparatus according to claim 9 or 10, wherein the execution unit is further configured to migrate a lock in a lock queue of a fourth update data block to the lock queue of the reserved data block if the value corresponding to the field stored in the reserved data block is lower than a first threshold, where the fourth update data block is an update data block in which the value corresponding to the field stored in the fourth update data block is updated to 0.
14. The apparatus of claim 8, wherein the n data blocks are update data blocks, and wherein the execution unit is further configured to:
receiving a third updating instruction, and generating a lock corresponding to the third updating instruction, wherein the third updating instruction is used for indicating to increase the numerical value of the field;
and adding a lock corresponding to the third updating instruction to a lock queue of a data block with least unexecuted updating instruction.
15. A server, characterized by comprising the numerical value updating apparatus according to any one of claims 8 to 14.
CN201611259773.7A 2016-12-30 2016-12-30 Numerical value updating method and device and server Active CN108268490B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611259773.7A CN108268490B (en) 2016-12-30 2016-12-30 Numerical value updating method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611259773.7A CN108268490B (en) 2016-12-30 2016-12-30 Numerical value updating method and device and server

Publications (2)

Publication Number Publication Date
CN108268490A CN108268490A (en) 2018-07-10
CN108268490B true CN108268490B (en) 2020-12-01

Family

ID=62754869

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611259773.7A Active CN108268490B (en) 2016-12-30 2016-12-30 Numerical value updating method and device and server

Country Status (1)

Country Link
CN (1) CN108268490B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013075427A1 (en) * 2011-11-22 2013-05-30 中兴通讯股份有限公司 Data update information obtaining method and device, and data synchronization method and device
CN103677751A (en) * 2012-09-06 2014-03-26 阿里巴巴集团控股有限公司 Task parallel processing method and device
CN105335394A (en) * 2014-07-14 2016-02-17 阿里巴巴集团控股有限公司 Data control method and system based on database

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8452948B2 (en) * 2010-06-28 2013-05-28 International Business Machines Corporation Hybrid compare and swap/perform locked operation queue algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013075427A1 (en) * 2011-11-22 2013-05-30 中兴通讯股份有限公司 Data update information obtaining method and device, and data synchronization method and device
CN103677751A (en) * 2012-09-06 2014-03-26 阿里巴巴集团控股有限公司 Task parallel processing method and device
CN105335394A (en) * 2014-07-14 2016-02-17 阿里巴巴集团控股有限公司 Data control method and system based on database

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于锁的事务并发控制";李海凌 等;《四川工业学院学报》;20030930(第3期);第99-103页 *

Also Published As

Publication number Publication date
CN108268490A (en) 2018-07-10

Similar Documents

Publication Publication Date Title
US10558672B1 (en) System and method for executing queries on multi-graphics processing unit systems
US11190618B2 (en) Scheduling method, scheduler, storage medium, and system
JP7083901B2 (en) Dark Roch Realization Method, Equipment, Computation Node and System
US8458712B2 (en) System and method for multi-level preemption scheduling in high performance processing
CN113296792B (en) Storage method, device, equipment, storage medium and system
CN102752198A (en) Multi-core message forwarding method, multi-core processor and network equipment
US10002023B2 (en) Method and apparatus for managing one or more tasks of a many-core system using one or more task descriptor entries
CN103500119B (en) A kind of method for allocating tasks based on pre-scheduling
CN108319495A (en) Task processing method and device
US11675622B2 (en) Leader election with lifetime term
CN112261115B (en) Resource allocation method, device and computer storage medium
CN105592110A (en) Resource scheduling method and device
CN112905342A (en) Resource scheduling method, device, equipment and computer readable storage medium
CN110609807A (en) Method, apparatus, and computer-readable storage medium for deleting snapshot data
CN109819674B (en) Computer storage medium, embedded scheduling method and system
CN108268490B (en) Numerical value updating method and device and server
CN112019577B (en) Exclusive cloud storage implementation method and device, computing equipment and computer storage medium
CN113849295A (en) Model training method and device and computer readable storage medium
Lipari The slurm scheduler design
CN104636205A (en) Task seizing method and device
KR101558807B1 (en) Processor scheduling method for the cooperation processing between host processor and cooperation processor and host processor for performing the method
CN114090234A (en) Request scheduling method and device, electronic equipment and storage medium
Vasu et al. Application Constraints and Safety Aware Mapping of AUTOSAR Applications on Multi-core Platforms
CN115878309A (en) Resource allocation method, device, processing core, equipment and computer readable medium
CN109787899B (en) Data partition routing method, device and system

Legal Events

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

Effective date of registration: 20211222

Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province

Patentee after: Super fusion Digital Technology Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right