CN116186046A - Device data modification method and device, computer device and storage medium - Google Patents

Device data modification method and device, computer device and storage medium Download PDF

Info

Publication number
CN116186046A
CN116186046A CN202310197560.XA CN202310197560A CN116186046A CN 116186046 A CN116186046 A CN 116186046A CN 202310197560 A CN202310197560 A CN 202310197560A CN 116186046 A CN116186046 A CN 116186046A
Authority
CN
China
Prior art keywords
data
target
identification code
category
equipment
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
Application number
CN202310197560.XA
Other languages
Chinese (zh)
Other versions
CN116186046B (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.)
Shenzhen Lexin Information Service Co ltd
Original Assignee
Shenzhen Lexin Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lexin Software Technology Co Ltd filed Critical Shenzhen Lexin Software Technology Co Ltd
Priority to CN202310197560.XA priority Critical patent/CN116186046B/en
Publication of CN116186046A publication Critical patent/CN116186046A/en
Application granted granted Critical
Publication of CN116186046B publication Critical patent/CN116186046B/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a device data modification method, a device, a computer device and a storage medium, wherein the device data is stored based on REDIS (remote control over the Internet) Hash objects, and the REDIS Hash objects store corresponding device data-data category correspondence relations corresponding to device identification codes, and the method comprises the following steps: acquiring a data modification instruction aiming at a target data category, and determining a target equipment identification code according to a preset corresponding relation between the equipment identification code and the data category and the target data category; determining a target equipment data-data category corresponding relation corresponding to the target equipment identification code from the equipment data-data category corresponding relation; and determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation, and modifying the target equipment data to obtain a modified REDIS Hash object. The invention realizes the conversion from full device data traversal to designated device data modification, and improves the modification efficiency of the device data in REDIS Hash objects.

Description

Device data modification method and device, computer device and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and apparatus for modifying device data, a computer device, and a storage medium.
Background
REDIS (Remote Dictionary Server, remote dictionary service) is a key-value memory database, and the data is stored in the memory, so that the REDIS database is often adopted for storage under the situation that a large amount of data needs to be accessed quickly, and the read-write speed is high. For example, in advertising, there are typically multiple vendors scoring at least one dimension for a portion of the devices on the market as a reference for advertising. In order to quickly configure a delivery policy based on scoring conditions of multiple manufacturers of each device and quickly respond, the scoring conditions of multiple manufacturers of each device are typically stored in the REDIS.
In practice, it is often necessary to modify the equipment components of a certain manufacturer in REDIS in a certain dimension that is evaluated. Conventional modification methods typically use brute force traversal to make the modification. However, since the number of devices reaches billions, modification of the device data in a violent traversal manner takes a long time and the flexibility of modification of the device data is poor in the face of huge device data.
Disclosure of Invention
The embodiment of the invention provides a device data modification method, a device, computer equipment and a storage medium, and aims to solve the technical problems that the existing REDIS hash object device data modification method is long in time consumption and poor in device data modification flexibility.
In a first aspect, an embodiment of the present invention provides a method for modifying device data, where the device data is stored based on a REDIS Hash object, where a device data-data class correspondence corresponding to device identifier codes of devices in a plurality of devices is stored in the REDIS Hash object, and the method includes:
acquiring a data modification instruction aiming at a target data category;
responding to the data modification instruction, and determining a target equipment identification code according to a preset equipment identification code-data category corresponding relation and the target data category;
determining a target equipment data-data category corresponding relation corresponding to the target equipment identification code from a plurality of equipment data-data category corresponding relations;
and determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation, and modifying the target equipment data in the target equipment data-data category corresponding relation to obtain a modified REDIS Hash object.
In a second aspect, an embodiment of the present invention provides an apparatus for modifying device data, where the apparatus includes:
an acquisition unit configured to acquire a data modification instruction for a target data category;
the first determining unit is used for responding to the data modification instruction and determining a target equipment identification code according to a preset corresponding relation between the equipment identification code and the data category and the target data category;
a second determining unit configured to determine a target device data-data category correspondence corresponding to the target device identification code from a plurality of the device data-data category correspondences;
and the modification unit is used for determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation, and modifying the target equipment data in the target equipment data-data category corresponding relation to obtain a modified REDIS Hash object.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for modifying device data of the first aspect when the processor executes the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, in which a computer program is stored, which when executed by a processor causes the processor to perform the method for modifying device data of the first aspect described above.
The embodiment of the invention provides a method for modifying equipment data, wherein the equipment data is stored based on REDIS Hash objects, the REDIS Hash objects are stored with corresponding equipment data-data category relations corresponding to equipment identification codes of all the equipment, and the method modifies the target equipment data in the corresponding relation of the target equipment data-data category through acquiring a data modification instruction aiming at the target data category, and responding to the data modification instruction, firstly determines the target equipment identification code according to the preset corresponding relation of the equipment identification code-data category and the target data category, further determines the corresponding relation of the target equipment data-data category corresponding to the target equipment identification code from the corresponding relation of the equipment data-data category, further determines the target equipment data corresponding to the target data category according to the corresponding relation of the target equipment data-data category, and further modifies the target equipment data in the corresponding relation of the target equipment data-data category, so that the modified REDIS Hash object is converted from full equipment data traversal to appointed equipment, time-consuming modification is reduced, and the flexibility of the modified equipment data of the REDIS Hash object is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario schematic diagram of a method for modifying device data according to an embodiment of the present invention;
FIG. 2 is a first flow chart of a method for modifying device data according to an embodiment of the present invention;
fig. 3 is a schematic diagram of storing device data in a method for modifying device data according to an embodiment of the present invention;
FIG. 4 is a second flow chart of a method for modifying device data according to an embodiment of the present invention;
FIG. 5 is a schematic block diagram of a device for modifying equipment data provided by an embodiment of the present invention;
fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, 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, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
The invention provides a device data modification method, a device, a computer device and a storage medium, which can improve the time consumption of device data modification in REDIS hash objects, and improve the device data modification efficiency and the device data modification flexibility.
Referring to fig. 1, fig. 1 is an application scenario schematic diagram of a method for modifying device data according to an embodiment of the present invention. The embodiment of the invention is based on REDIS (Remote Dictionary Server, remote dictionary service) which is a key-value type memory database, and the data is stored in the memory, so that the read-write speed is very high. Specifically, in the embodiment of the invention, REDIS Hash objects are adopted to store device data, the Hash data structure is equivalent to that a layer of key-value type data is sleeved in the value, as shown in fig. 1, and the device data is actually stored in the value area in fig. 1. Taking advertisement delivery as a specific application scenario, REDIS in FIG. 1 may store device parts (device data) corresponding to legal devices (e.g., 35 million devices) on the market, where the device parts are obtained by multiple scoring manufacturers scoring some or all of the 35 million devices using a preset scoring model, e.g., A manufacturer scores 20 of the devices in 2 dimensions, B manufacturer scores 10 of the devices in 1 dimension, C manufacturer scores 15 of the devices in 2 dimensions, where these scores are all stored in one REDIS, and modification of the scoring data in a certain dimension of the C manufacturer is required (e.g., modification of the data in the storage location shown by the dashed line in FIG. 1 is essentially required).
Based on this, referring to fig. 2, fig. 2 is a flowchart of a method for modifying device data according to an embodiment of the present invention, in which device data is stored based on a dis Hash object, and the dis Hash object stores device data-data type correspondence relationships corresponding to device identification codes of devices in a plurality of devices, respectively, and the method specifically includes steps S101 to S104 described below.
Step S101, a data modification instruction aiming at a target data category is acquired.
In this embodiment, the target data class is one of multiple data classes stored in the REDIS Hash object to be modified, for example, may be a data modification instruction for the device data of the first dimension of the manufacturer C.
Specifically, the data modification instruction may be a data replacement instruction, that is, replacing the device data of the target data class with other newly added device data; the data modification instruction may also be a data purge instruction, i.e., a device data purge of the target data class is set to 0.
Step S102, responding to the data modification instruction, and determining a target equipment identification code according to a preset corresponding relation between the equipment identification code and the data type and the target data type.
The device identification code is an identification code of the device, which can uniquely identify the device, for example, a mobile device identification code (Mobile Equipment Identifier, MEID), an international mobile device identification code (International Mobile Equipment Identity, IMEI), etc.
In this embodiment, after receiving the data modification instruction for the target data class, the device to which the data modification instruction for the target data class points, that is, the target device identifier code, is first determined, so that the target device data code of the target device including the target data class in the device data is determined based on the preset device identifier code-data class correspondence relationship and the target data class.
Specifically, the device identifier-data type correspondence indicates a data type condition corresponding to each device stored in the current REDIS Hash object, and in an embodiment, the device identifier-data type correspondence may include a device identifier-data type storage record table, where a device identifier of each device in the plurality of devices stored in the current REDIS Hash object and a stored data type corresponding to the device identifier are recorded, and the device identifier-data type storage record table may be shown in table 1, for example.
TABLE 1
Figure BDA0004107777320000051
It can be seen from this table that there is no scoring data stored in the factory C-dimension 1 and factory C-dimension 2 in the current REDIS Hash object for both devices with device identification codes XXXXX3 and XXXX.
On this basis, in the process of determining the target device identifier according to the preset device identifier-data category correspondence and the target data category, a query statement for querying the target device identifier including the target data category in the data categories stored in each device identifier in table 1 may be written, and then the query statement is executed, and the target device identifier file storing the target device identifier may be derived.
In particular, in some implementations, the database plug-in fdw (foreign data wrapper, externally packaged data) can be utilized to verify the grammatical correctness of the query statement prior to executing the query statement.
In this embodiment, the target query field of the query statement is a device identifier, and the query thought of the query statement may be to query a device identifier including a target data class, and then use each queried device identifier as the target device identifier.
For example, if the data modification instruction for the target data class is a data clearing instruction for the device data of vendor C-dimension 1, after querying table 1, it may be determined that the obtained target device identification codes include xxxx1 and xxxx2.
It should be noted that, the device identifier-data category storage record table included in the preset device identifier-data category correspondence may be a record table that exists directly, or may be a record table obtained by querying and integrating other record tables, which is not limited in this invention.
Step S103, determining a target device data-data category corresponding relation corresponding to the target device identification code from a plurality of device data-data category corresponding relations.
In this embodiment, the REDIS Hash object stores a plurality of device data-data class correspondence relationships, where each device corresponds to one device data-data class correspondence relationship, and after determining the target device code, the device data-data class correspondence relationship corresponding to the target device code may be determined as the target device data-data class correspondence relationship.
Specifically, in some embodiments, the storage location of the device data-data class corresponding relation corresponding to each device in the REDIS Hash may perform a mapping operation on the device identifier of the device when the REDIS Hash object is created, and use the result obtained by the mapping budget as a key value and a field key value, so as to store the device data-data class corresponding relation corresponding to the device in the value corresponding to the key value and the field key value. On this basis, in some embodiments of the present invention, in the process of determining the corresponding relationship between the data and the data of the target device corresponding to the target device identifier, the mapping operation may be performed on the target device identifier to obtain a target key value (such as a key value and a field key value shown in fig. 1) corresponding to the target device identifier, so as to determine the corresponding relationship between the data and the data of the device corresponding to the target key value as the corresponding relationship between the data and the data of the target device.
The mapping operation may be a hash operation, specifically, the device identifier code may be operated according to a first hash algorithm, the obtained hash value is obtained by modulo the total number of key keys and is used as a key value, the device identifier code is operated according to a second hash algorithm, the obtained hash value is used as a field key value, and then the corresponding relationship between device data and data category corresponding to the device identifier code is stored in the key value and the value corresponding to the field key value. The first hash algorithm and the second hash algorithm may be existing hash functions, for example, MD4 (RFC 1320), MD5 (RFC 1321), and the like, which is not limited by the present invention.
In this embodiment, the above-mentioned correspondence relationship between device data and data types may be specifically an array for storing device data of multiple data types, for example, as shown in fig. 3, each element in the array is device data, and the data type corresponding to each device data may be determined based on a preset data type storage location allocation manner, for example, the first 2 elements of the array are device data of manufacturer a-dimension 1 and manufacturer a-dimension 2, the 3 rd element of the array is device data of manufacturer B-dimension 1, and the 4 th and 5 th elements of the array are device data of manufacturer C-dimension 1 and manufacturer C-dimension 2, respectively.
In this embodiment, the device data-data type correspondence relationship where the device data to be subjected to data modification is located, that is, the target value (for example, the value marked by the dotted line) in each value shown in fig. 1, may be determined by the target device identification code.
Step S104, determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation, and modifying the target equipment data in the target equipment data-data category corresponding relation to obtain a modified REDIS Hash object.
In this embodiment, after determining the corresponding relationship between the target device data and the data type, the device data (serving as the target device data) corresponding to the target data type may be determined according to a preset data type storage location allocation manner, so as to modify the target device data, and the specific modification manner may modify the target device data through a REDIS command.
In some application scenarios, the number of target device identification codes reaches a hundred million level, for example, the target device identification code corresponding to vendor C reaches 15 hundred million, so as to further increase the modification speed of the device data, in an embodiment, as shown in fig. 4, in the process of step S102, if the target device identification code file storing the target device identification code is obtained, the modification speed of the device data may be increased in the process of step S103 by a manner of distributing tasks through a message queue, that is, step S103 may further specifically include the following steps S401 to S403, and step S104 may be implemented based on step S404.
And S401, performing file segmentation on the target equipment identification code file to generate a plurality of subfile tasks.
Wherein, the sub-file task comprises one or more target equipment identification codes. In some embodiments, if the data modification instruction is a data replacement instruction, the subfile task may further include replacement device data corresponding to the target device identifier.
Step S402, the plurality of sub-file tasks are sent to a first message queue, and the plurality of sub-file tasks are distributed to a plurality of consumption devices through the first message queue.
The consumer device refers to a terminal device that processes a task in the first message queue, for example, it may be a computer device.
Step S403, determining, by the plurality of consumer devices, a target device data-data category correspondence corresponding to the target device identification code in the sub-file task from the plurality of device data-data category correspondences.
Step S404, determining target device data corresponding to the target data category according to the target device data-data category correspondence by the plurality of consumer devices, and modifying the target device data in the target device data-data category correspondence to obtain a modified REDIS Hash object.
In an embodiment, after receiving the sub-file task, the consumer device may further perform the step S403 and the step S404 based on multithreading, so as to further improve the device data modification efficiency.
In this embodiment, the target device identifier file stored with the target device identifier is split, so as to generate a sub-file task, so that the sub-file task is distributed to a plurality of consumption devices for consumption through a message queue, thereby avoiding the need of designing complex logic to distribute the target device identifier to be modified when the plurality of devices are directly adopted for processing, further using multithreading to carry out data modification processing in each consumption device on the basis, and realizing the modification time of device data on three levels (full-scale traversal is designated for modification, parallel data modification is carried out by using a plurality of consumption devices, and the consumption devices carry out data modification based on multithreading), thereby improving the flexibility and the order of device data modification.
In an embodiment, the sub-file task may include a plurality of target device identifier codes, so that each consumer device may split the sub-file task into a plurality of target device identifier sub-tasks during device data modification based on each of the plurality of target device identifier codes, and then send the plurality of target device identifier sub-tasks to the second message queue, and further determine, from the plurality of device data-data category correspondence relationships, target device data corresponding to the target device identifier codes in the target device identifier sub-task, according to the target device data-data category correspondence, and modify the target device data in the target device data-data category correspondence, thereby improving the order of the data modification process.
In some embodiments, after the consumption device obtains the target device identification subtask distributed by the second message queue, the consumption device can also process the target device identification subtask based on multithreading, so that the data modification order and modification efficiency are improved.
In summary, the embodiment of the invention provides a method for modifying device data, in which the device data is stored based on a REDIS Hash object, and the REDIS Hash object stores device data-data category correspondence corresponding to device identification codes of devices in a plurality of devices, and the method obtains a modified REDIS Hash object by acquiring a data modification instruction for a target data category, determining a target device identification code according to a preset device identification code-data category correspondence and a target data category in response to the data modification instruction, determining a target device data-data category correspondence corresponding to the target device identification code from the plurality of device data-data category correspondence, further determining target device data corresponding to the target data category according to the target device data-data category correspondence, and modifying the target device data in the target device data-data category correspondence, thereby realizing the modification of full-volume device traversal to the designated device, reducing the time consumption of modifying the device data in the REDIS Hash object, and improving the flexibility of modifying the device data.
Since 3000 ten thousand key values can be stored in REDIS, 512 fields can be stored for each key, and 153.6 hundred million devices can be stored in 1 REDIS. On the basis, if 1 hundred million devices of device data are required to be modified, the traditional method needs full data traversal, 153.6 hundred million devices of device data are required to be traversed in total, if 10 devices are used for processing, 200 threads are used for each device, and when the modification of 1 device of device data is required to be processed by a single device and a single thread, 70ms is required for modification of 1 device of device data, the invention needs 100000000 x 0.07/10/200=3500 seconds, namely less than 1 hour, and can complete the replacement of 1 hundred million devices of device data, while for the traditional method, 15360000000 x 0.07/10/200/3600/24=6.2 days, so that the invention greatly shortens the modification time of the device data and provides the flexibility of device data modification.
The embodiment of the invention also provides a device for modifying the equipment data, which is used for executing the steps in any embodiment of the method for modifying the equipment data. Specifically, referring to fig. 5, fig. 5 shows a schematic structural diagram of a device data modification apparatus 500 according to an embodiment of the present invention, where the device data modification apparatus 500 specifically includes an obtaining unit 501, a first determining unit 502, a second determining unit 503, and a modifying unit 504, where,
an obtaining unit 501, configured to obtain a data modification instruction for a target data class;
a first determining unit 502, configured to determine, in response to the data modification instruction, a target device identifier according to a preset device identifier-data class correspondence and the target data class;
a second determining unit 503 configured to determine a target device data-data category correspondence corresponding to the target device identification code from a plurality of the device data-data category correspondences;
a modifying unit 504, configured to determine target device data corresponding to the target data class according to the target device data-data class corresponding relationship, and modify the target device data in the target device data-data class corresponding relationship, to obtain a modified REDIS Hash object.
In some embodiments of the present invention, the second determining unit 503 may be further specifically configured to perform a mapping operation on the target device identifier to obtain a target key value corresponding to the target device identifier; and determining the equipment data-data category corresponding relation corresponding to the target key value as the target equipment data-data category corresponding relation.
In some embodiments of the present invention, the first determining unit may be further specifically configured to write a query statement for querying, in the device identifier-data class storage record table, the target device identifier including the target data class in the data class stored in each device identifier; and executing the query statement and exporting a target equipment identification code file storing the target equipment identification code.
In some embodiments of the present invention, the first determining unit 502 may be further specifically configured to perform file segmentation on the target device identifier file to generate a plurality of subfile tasks; the subfile task comprises one or more target equipment identification codes; sending the plurality of sub-file tasks to a first message queue, and distributing the plurality of sub-file tasks to a plurality of consumption devices through the first message queue; determining, by the plurality of consumer devices, a target device data-data category correspondence corresponding to the target device identification code in the subfile task from a plurality of the device data-data category correspondences; the second determining unit 503 may be further specifically configured to determine, by the plurality of consumer devices, target device data corresponding to the target data class according to the target device data-data class corresponding relationship, and modify the target device data in the target device data-data class corresponding relationship.
In some embodiments of the present invention, the second determining unit 503 may be further specifically configured to determine, by each of the plurality of consumer devices, a target device data-data class correspondence corresponding to the target device identification code in the subfile task from a plurality of device data-data class correspondences based on multithreading; the modification unit 504 may be specifically configured to determine, by using each of the plurality of consumer devices, target device data corresponding to the target data class according to the target device data-data class correspondence based on multithreading, and modify the target device data in the target device data-data class correspondence.
In some embodiments of the present invention, the second determining unit 503 may be further specifically configured to split, by each of the plurality of consumption devices, the sub-file task into a plurality of target device identification sub-tasks; and sending the plurality of target equipment identification subtasks to a second message queue through each consumption equipment, and determining a target equipment data-data category corresponding relation corresponding to a target equipment identification code in the target equipment identification subtask from a plurality of equipment data-data category corresponding relations based on the distribution of the target equipment identification subtasks by the second message queue.
It should be noted that, as those skilled in the art can clearly understand the modification device of the device data and the specific implementation process of each unit, reference may be made to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, details are not repeated here.
The above-described device data modification means may be embodied in the form of a computer program which is executable on a computer device as shown in fig. 6.
Referring to fig. 6, fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device 600 may be a terminal device such as a smart phone, tablet computer, personal Computer (PC) device, etc. With reference to fig. 6, the computer device 600 includes a processor 602, a memory and a network interface 605 connected by a device bus 601, wherein the memory may include a storage medium 603 and an internal memory 604.
The storage medium 603 may store an operating system 6031 and a computer program 6032. The computer program 6032, when executed, can cause the processor 602 to perform a method of modifying device data.
The processor 602 is used to provide computing and control capabilities to support the operation of the overall computer device 600.
The internal memory 604 provides an environment for the execution of a computer program 6032 in the storage medium 603, which computer program 6032, when executed by the processor 602, causes the processor 602 to perform a method of modifying device data.
The network interface 605 is used for network communications, such as providing for the transmission of data information, etc. It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device 600 to which the present inventive arrangements may be applied, and that a particular computer device 600 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor 602 is configured to execute a computer program 6032 stored in the memory to implement the method for modifying device data disclosed in the embodiment of the invention.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 6 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 6, and will not be described again.
It should be appreciated that in embodiments of the invention, the processor 602 may be a central processing unit (Central Processing Unit, CPU), the processor 602 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a nonvolatile computer readable storage medium or a volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor implements the method for modifying device data disclosed in the embodiments of the present invention.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software 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 invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another apparatus, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units may be stored in a storage medium if implemented in the form of software functional units and sold or used as stand-alone products. Based on such understanding, the technical solution of the present invention may be essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a background server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The present invention is not limited to the above embodiments, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the present invention, and these modifications and substitutions are intended to be included in the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. The method for modifying device data is characterized in that the device data is stored based on REDIS Hash objects, and the REDIS Hash objects store corresponding relationships between device data and data types, wherein the corresponding relationships correspond to device identification codes of devices in a plurality of devices respectively, and the method comprises the following steps:
acquiring a data modification instruction aiming at a target data category;
responding to the data modification instruction, and determining a target equipment identification code according to a preset equipment identification code-data category corresponding relation and the target data category;
determining a target equipment data-data category corresponding relation corresponding to the target equipment identification code from a plurality of equipment data-data category corresponding relations;
and determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation, and modifying the target equipment data in the target equipment data-data category corresponding relation to obtain a modified REDIS Hash object.
2. The method of claim 1, wherein the determining a target device data-data class correspondence corresponding to the target device identification code from a plurality of the device data-data class correspondences comprises:
mapping operation is carried out on the target equipment identification code, and a target key value corresponding to the target equipment identification code is obtained;
and determining the equipment data-data category corresponding relation corresponding to the target key value as the target equipment data-data category corresponding relation.
3. The method according to claim 1 or 2, wherein the preset device identification code-data class correspondence relationship includes a device identification code-data class storage record table, wherein the device identification code-data class storage record table records therein a device identification code of each device of the plurality of devices stored in the REDIS Hash object currently and a stored data class corresponding to the device identification code; the determining the target equipment identification code according to the preset equipment identification code-data category corresponding relation and the target data category comprises the following steps:
writing a query statement for querying the target equipment identification code comprising the target data category in the data category stored in each equipment identification code in the equipment identification code-data category storage record table;
and executing the query statement and exporting a target equipment identification code file storing the target equipment identification code.
4. The method of claim 3, wherein the determining a target device data-data class correspondence corresponding to the target device identification code from a plurality of the device data-data class correspondences comprises:
performing file segmentation on the target equipment identification code file to generate a plurality of sub-file tasks; the subfile task comprises one or more target equipment identification codes;
sending the plurality of sub-file tasks to a first message queue, and distributing the plurality of sub-file tasks to a plurality of consumption devices through the first message queue;
determining, by the plurality of consumer devices, a target device data-data category correspondence corresponding to the target device identification code in the subfile task from a plurality of the device data-data category correspondences;
the determining the target device data corresponding to the target data category according to the target device data-data category correspondence, and modifying the target device data in the target device data-data category correspondence, includes:
and determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation by the plurality of consumption equipment, and modifying the target equipment data in the target equipment data-data category corresponding relation.
5. The method of claim 4, wherein the determining, by the plurality of consumer devices, a target device data-data class correspondence corresponding to the target device identification code in the subfile task from a plurality of the device data-data class correspondences comprises:
determining, by each of the plurality of consumer devices, a target device data-data class correspondence corresponding to the target device identification code in the subfile task from a plurality of the device data-data class correspondences based on multithreading;
the determining, by the plurality of consumer devices, target device data corresponding to the target data class according to the target device data-data class correspondence, and modifying the target device data in the target device data-data class correspondence, includes:
determining target device data corresponding to the target data category according to the target device data-data category corresponding relation based on multithreading through each of the plurality of consumer devices, and modifying the target device data in the target device data-data category corresponding relation.
6. The method according to claim 4 or 5, wherein a plurality of said target device identification codes are included in said sub-file task; the determining, by the plurality of consumer devices, a target device data-data class correspondence corresponding to the target device identification code in the subfile task from a plurality of the device data-data class correspondences, including:
splitting, by each of the plurality of consumer devices, the sub-file task into a plurality of target device identification sub-tasks;
and sending the plurality of target equipment identification subtasks to a second message queue through each consumption equipment, and determining a target equipment data-data category corresponding relation corresponding to a target equipment identification code in the target equipment identification subtask from a plurality of equipment data-data category corresponding relations based on the distribution of the target equipment identification subtasks by the second message queue.
7. The method of claim 1, wherein the device data is a device score obtained by scoring a device based on a preset scoring model.
8. A device data modification apparatus, comprising:
an acquisition unit configured to acquire a data modification instruction for a target data category;
the first determining unit is used for responding to the data modification instruction and determining a target equipment identification code according to a preset corresponding relation between the equipment identification code and the data category and the target data category;
a second determining unit configured to determine a target device data-data category correspondence corresponding to the target device identification code from a plurality of the device data-data category correspondences;
and the modification unit is used for determining target equipment data corresponding to the target data category according to the target equipment data-data category corresponding relation, and modifying the target equipment data in the target equipment data-data category corresponding relation to obtain a modified REDIS Hash object.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN202310197560.XA 2023-02-24 2023-02-24 Device data modification method and device, computer device and storage medium Active CN116186046B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310197560.XA CN116186046B (en) 2023-02-24 2023-02-24 Device data modification method and device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310197560.XA CN116186046B (en) 2023-02-24 2023-02-24 Device data modification method and device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN116186046A true CN116186046A (en) 2023-05-30
CN116186046B CN116186046B (en) 2024-02-20

Family

ID=86442172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310197560.XA Active CN116186046B (en) 2023-02-24 2023-02-24 Device data modification method and device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN116186046B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150095341A1 (en) * 2013-09-27 2015-04-02 International Business Machines Corporation System and a method for hierarchical data column storage and efficient query processing
US20150301875A1 (en) * 2014-04-22 2015-10-22 Andreas Harnesk Persisting and managing application messages
US20180039630A1 (en) * 2013-03-08 2018-02-08 Google Inc. System for serving shared content on a video sharing web site
US20180322401A1 (en) * 2017-05-03 2018-11-08 Oracle International Corporation Object count prediction using distributed processing
CN108874873A (en) * 2018-04-26 2018-11-23 北京空间科技信息研究所 Data query method, apparatus, storage medium and processor
US10685047B1 (en) * 2016-12-08 2020-06-16 Townsend Street Labs, Inc. Request processing system
CN111309740A (en) * 2020-01-16 2020-06-19 中国建设银行股份有限公司 Data processing method, device, equipment and storage medium
CN111797351A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Page data management method and device, electronic equipment and medium
US20210209146A1 (en) * 2020-04-08 2021-07-08 Baidu Online Network Technology (Beijing) Co., Ltd. Method and apparatus for searching multimedia content device, and storage medium
CN113656423A (en) * 2021-08-18 2021-11-16 北京百度网讯科技有限公司 Method and device for updating data, electronic equipment and storage medium
CN114610808A (en) * 2022-03-17 2022-06-10 中银金融科技有限公司 Data storage method, data storage device, electronic equipment and medium
CN115687250A (en) * 2021-07-21 2023-02-03 中移(苏州)软件技术有限公司 Storage method, equipment, system and computer storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180039630A1 (en) * 2013-03-08 2018-02-08 Google Inc. System for serving shared content on a video sharing web site
US20150095341A1 (en) * 2013-09-27 2015-04-02 International Business Machines Corporation System and a method for hierarchical data column storage and efficient query processing
US20150301875A1 (en) * 2014-04-22 2015-10-22 Andreas Harnesk Persisting and managing application messages
US10685047B1 (en) * 2016-12-08 2020-06-16 Townsend Street Labs, Inc. Request processing system
US20180322401A1 (en) * 2017-05-03 2018-11-08 Oracle International Corporation Object count prediction using distributed processing
CN108874873A (en) * 2018-04-26 2018-11-23 北京空间科技信息研究所 Data query method, apparatus, storage medium and processor
CN111309740A (en) * 2020-01-16 2020-06-19 中国建设银行股份有限公司 Data processing method, device, equipment and storage medium
US20210209146A1 (en) * 2020-04-08 2021-07-08 Baidu Online Network Technology (Beijing) Co., Ltd. Method and apparatus for searching multimedia content device, and storage medium
CN111797351A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Page data management method and device, electronic equipment and medium
CN115687250A (en) * 2021-07-21 2023-02-03 中移(苏州)软件技术有限公司 Storage method, equipment, system and computer storage medium
CN113656423A (en) * 2021-08-18 2021-11-16 北京百度网讯科技有限公司 Method and device for updating data, electronic equipment and storage medium
CN114610808A (en) * 2022-03-17 2022-06-10 中银金融科技有限公司 Data storage method, data storage device, electronic equipment and medium

Also Published As

Publication number Publication date
CN116186046B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN102982141B (en) A kind of method and device realizing distributed data base agency
US10275345B2 (en) Application experiment system
CN105100051A (en) Method and system for realizing data resource access right control
WO2018000607A1 (en) Method and electronic apparatus for identifying test case failure causes
CN110830234B (en) User traffic distribution method and device
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
CN110445828B (en) Data distributed processing method based on Redis and related equipment thereof
WO2019104891A1 (en) Method and device for importing and exporting report, storage medium, and terminal
CN111506611A (en) Data query method, device, equipment and storage medium
CN111767144A (en) Transaction routing determination method, device, equipment and system for transaction data
US20200329108A1 (en) Program operation system and program operation method
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
CN104363112A (en) Parameter management method and parameter management device
US9104567B2 (en) Memory-leak identification
CN109684033B (en) Cloud platform bare metal management method, storage medium, electronic device and system
CN108900482B (en) Script execution method, server management system, and storage medium
CN116186046B (en) Device data modification method and device, computer device and storage medium
CN110597613A (en) Task processing method, device, equipment and computer readable storage medium
US11093266B2 (en) Using a generative model to facilitate simulation of potential policies for an infrastructure as a service system
CN107169115A (en) Add the method and device of self-defined participle
CN111143196A (en) Database testing method and device
CN113132241B (en) ACL template dynamic configuration method and device
CN111143326B (en) Method, apparatus, computer device and storage medium for reducing database operations
CN114553859A (en) BMC configuration management method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20240118

Address after: 518000 1801, China energy storage building, 3099 Keyuan South Road, high tech community, Yuehai street, Nanshan District, Shenzhen, Guangdong

Applicant after: Shenzhen Lexin Information Service Co.,Ltd.

Address before: Floor 24, China energy storage building, 3099 Keyuan South Road, Yuehai street, Nanshan District, Shenzhen, Guangdong 518000

Applicant before: SHENZHEN LEXIN SOFTWARE TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant