CN114817688A - User information loading method and device, electronic equipment and storage medium - Google Patents
User information loading method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114817688A CN114817688A CN202210439809.9A CN202210439809A CN114817688A CN 114817688 A CN114817688 A CN 114817688A CN 202210439809 A CN202210439809 A CN 202210439809A CN 114817688 A CN114817688 A CN 114817688A
- Authority
- CN
- China
- Prior art keywords
- user
- user information
- information
- target
- loading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 57
- 238000000034 method Methods 0.000 claims description 29
- 230000006870 function Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 12
- 238000010276 construction Methods 0.000 claims description 10
- 238000000605 extraction Methods 0.000 claims description 7
- 238000001028 reflection method Methods 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 6
- 238000004806 packaging method and process Methods 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 claims description 4
- 238000005516 engineering process Methods 0.000 abstract description 7
- 230000010365 information processing Effects 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 8
- 238000007726 management method Methods 0.000 description 6
- 239000003607 modifier Substances 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000013500 data storage Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 238000006243 chemical reaction Methods 0.000 description 3
- 241000555745 Sciuridae Species 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000013479 data entry Methods 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9532—Query formulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
- G06F16/316—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/335—Filtering based on additional data, e.g. user or group profiles
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to an information processing technology, and discloses a user information loading method, which comprises the following steps: when a login instruction of a target user is received, analyzing a target access thread of the target user from the login instruction; extracting a request head in the login instruction through reflection operation; performing ID tracing on the request header to obtain a user ID; reading the user information of the target user from preset storage information according to the user ID; and writing the user information into the target access thread in a cache loading mode. In addition, the invention also relates to a block chain technology, and the data list can be stored in the node of the block chain. The invention also provides a user information loading device, electronic equipment and a storage medium. The invention can improve the efficiency of loading the user information.
Description
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for loading user information, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of information technology, users use the internet more and more frequently, and data-related problems are inevitably propagated. The mass text data emerging on the internet not only brings rich corpus resources, but also makes the text perception, analysis and processing face huge challenges. Each user can generate and propagate data with the largest proportion of text, which results in a load on the program application and reduces the data loading speed. In order to make each user obtain good use experience, it is not easy to improve the loading efficiency of user information.
In most enterprise application systems, user information is generally acquired in a manner that other service modules rely on jar packages of the whole user basic module or cross-module call an information query interface of a user management module. There is a high degree of association between service modules, and the higher the coupling between modules, the worse the independence. When the code is modified, a water wave effect is often generated, user information loading is involved, and therefore user information loading efficiency is low. Therefore, how to improve the efficiency of loading the user information becomes a problem to be solved urgently.
Disclosure of Invention
The invention provides a user information loading method and device and a computer readable storage medium, and mainly aims to solve the problem of low efficiency in user information loading.
In order to achieve the above object, a user information loading method provided by the present invention includes:
when a login instruction of a target user is received, analyzing a target access thread of the target user from the login instruction;
extracting a request head in the login instruction through reflection operation;
performing ID tracing on the request header to obtain a user ID;
reading the user information of the target user from preset storage information according to the user ID;
and writing the user information into the target access thread in a cache loading mode.
Optionally, the extracting a target access thread of the target user from the login instruction includes:
converting the login instruction into a text;
performing hash mapping on the text to obtain a key value of the login instruction;
and analyzing the key value by using a preset instruction analyzer to obtain the user ID and the target access thread of the target user.
Optionally, the extracting, by reflection operation, a request header in the login instruction includes:
traversing and determining a request header data class in the login instruction;
acquiring a reflection object, a reflection construction method, a reflection attribute object and a reflection method object according to the request header data class;
constructing a reflection operation by using the reflection object, the reflection construction method, the reflection attribute object and the reflection method object;
and performing reflection operation on the request head data class to obtain a request head.
Optionally, the performing ID tracing on the request header to obtain a user ID includes:
constructing a request head extraction statement according to the request head;
executing the request header extraction statement to extract a request message header in the access request;
and analyzing the message header to obtain the user ID.
Optionally, the reading out the user information of the target user from the stored information according to the user ID includes:
acquiring an index of the stored information by using a preset index function;
and searching in the index by using the user ID, and collecting the searched information as the user information of the target user.
Optionally, the writing the user information of the target user into the target access thread in a cache loading manner includes:
creating a data cache in the target access thread;
and decoding the user information, and loading the decoded user information into the data cache.
Optionally, before the reading out the user information of the target user from the preset storage information according to the user ID, the method further includes:
acquiring user information, and packaging the user information to obtain a packaged object;
and converting the packaged object into a character string for storage, wherein the character string is used as storage information.
In order to solve the above problem, the present invention further provides a user information loading apparatus, including:
the instruction analysis module is used for analyzing a target access thread of a target user from a login instruction when the login instruction of the target user is received;
the reflection operation module is used for extracting a request head in the login instruction through reflection operation;
the information tracing module is used for carrying out ID tracing on the request head to obtain a user ID;
the information reading module reads the user information of the target user from preset storage information according to the user ID;
and the information loading module writes the user information of the target user into the target access thread in a cache loading mode.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the user information loading method described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the user information loading method described above.
In the embodiment of the invention, the login instruction of the target user is acquired, the target access thread of the target user is analyzed by using the login instruction, the ID is traced to obtain the user information, and the user information is written into the target access thread, so that the system access step is omitted, and the user information is more conveniently loaded.
Drawings
Fig. 1 is a schematic flowchart of a user information loading method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating instruction parsing according to an embodiment of the invention;
fig. 3 is a schematic flow chart of information reading according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a user information loading apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the user information loading method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a user information loading method. The execution subject of the user information loading method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiment of the present application, such as a server, a terminal, and the like. In other words, the user information loading method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a user information loading method according to an embodiment of the present invention. In this embodiment, the user information loading method includes:
and S1, when the login instruction of the target user is received, extracting and analyzing the target access thread of the target user from the login instruction.
In this embodiment of the present invention, the extracting and parsing out the target access thread of the target user from the login instruction includes:
s21, converting the login instruction into a text;
s22, carrying out Hash mapping on the text to obtain a key value of the login instruction;
and S23, analyzing the key value by using a preset instruction analyzer to obtain a target access thread of the target user.
In detail, the key value may include: the user name of the target user and the target access thread.
Specifically, the hash mapping is to convert a key word into an integer number through a fixed algorithm function, i.e., a so-called hash function, then perform a remainder on the length of the array by the number, take the remainder as an index of the array, and store the value in an array space with the number as the index. Alternatively, an input of arbitrary length (also called a pre-map) is converted by a hash algorithm into an output of fixed length, which is a hash value. This transformation is a compression mapping, i.e., the space of hash values is usually much smaller than the space of inputs, and different inputs may hash to the same output, without the possibility of uniquely determining the input value from the hash value, simply a function of compressing a message of arbitrary length to a message digest of some fixed length.
And S2, extracting the request header in the login instruction through reflection operation.
In this embodiment of the present invention, the extracting, by reflection operation, the request header in the login instruction includes:
traversing and determining a request header data class in the login instruction;
acquiring a reflection object, a reflection construction method, a reflection attribute object and a reflection method object according to the request header data class;
constructing a reflection operation by using the reflection object, the reflection construction method, the reflection attribute object and the reflection method object;
and performing reflection operation on the request head data class to obtain a request head.
In detail, in the embodiment of the present invention, a preset java statement may be used to traverse the login instruction to determine a request header data class in the login instruction, where the request header data class may be used to implement the login instruction, and a request header may be obtained by performing a reflection operation on the request header data class. For example: java reflection is in a running state, and all attributes and methods of any class can be known; for any object, any method and attribute of the object can be called; and can change its properties. The reflection mechanism allows a program to get internal information of class under any known name at run-time.
Specifically, the method for acquiring the reflection object may be class name acquisition, getclass acquisition, or class loader acquisition; the reflection construction method can refer to Constructor, and can acquire a public construction function with a specified name and any construction function with a specified name; the reflection Method may refer to a Method, a common Method for acquiring a designated name, all methods of reading out an object, and an arbitrary Method of designating a name.
In detail, the performing of the reflection operation on the request header data class obtains a request header, for example, when the request header is "name", the request header data class is "c1", and when "c1" is input, "name" may be output according to the reflection operation.
And S3, performing ID tracing on the request header to obtain the user ID.
In this embodiment of the present invention, the performing ID tracing on the request header includes:
constructing a request head extraction statement according to the request head;
executing the request header extraction statement to extract a request message header in the login instruction;
and acquiring the user ID from the message header by using a preset resolver.
Further, in this embodiment of the present invention, a parser may be used to parse the message header to obtain the user ID in the request message header, where the preset parser includes carakan C/C + +, squirrel fisherc + +, squirrel fisherxtremc + +, and the like.
Specifically, the tracing process may be to obtain a request message header in the login instruction according to the extraction statement, assign an attribute to the request message header by using a default reflection construction method, obtain a modifier list of the attribute, where the returned modifier is a number, and each number is a code number of the modifier; and converting the Modifier into a character string by using a toString statement of a Modifier class, and acquiring the name of the character string, namely the name of the character string is the user ID.
And S4, reading the user information of the target user from the preset storage information according to the user ID.
In this embodiment of the present invention, before writing the user information of the target user into the target access thread in a cache loading manner, the method further includes: acquiring user information, and packaging the user information to obtain a packaged object; and converting the packaged object into a character string for storage, wherein the character string is used as storage information.
In the embodiment of the invention, the user information is obtained by integrating the personal information and the operation command of the target user according to the service requirement of the target user after the target user logs in the system.
In detail, the personal information may include, but is not limited to, a user's ID, a location, a nickname, age, gender, and hobbies. For example, the user registration information and basic data filled in during user registration; user browsing behavior data obtained from website logs; acquiring user website service application data from a database; derivation and prediction based on user historical data; user data obtained by directly contacting the user or a way of user research; user data provided by a third party service authority.
Specifically, the operation command refers to a selection command of the target user on a certain interface, a click command on a certain button, and the like.
In detail, the encapsulating the user information to obtain an encapsulated object includes:
converting the user information into a data segment with a preset format;
and converting the data segment into a data packet, and adding a logical address and a physical address into the data packet to obtain a packaging object of the user information.
In detail, the user information is converted into the data segment with the preset format, so that unification of all data formats in the user information can be realized, and the efficiency of packaging the user information is improved.
Specifically, the data segment in the preset format may include, but is not limited to, a data segment in a TCP format and a data segment in a UDP format. The header of the TCP segment has 10 necessary fields and 1 optional field, the header is at least 20 bytes, and the data behind the header is optional; in the UDP data segment format, the port number field of a source and a target occupy 16 bits, the length field occupies 16 bits, and the checksum field occupies 16 bits.
In particular, the data packets are units of data in a TCP/IP protocol communication transmission, also referred to as "packets". Is self-contained with sufficient addressing information to be transmitted independently from the source host to the destination host without relying on earlier exchanges of information between the source host and the destination host and the transmission of network packets.
In detail, the physical address is an address loaded into a memory address register, the real address of the memory unit, and the memory address transmitted on the front-end bus are all physical memory addresses, and the number is from 0 to the highest end of the available physical memory; the logical address is an address generated by the CPU. Logical addresses are internal and used for programming and are not unique. An array is allocated in a piece of code, and logical addresses are continuous, however, pages occupied by the array can be scattered on physical addresses, and the physical addresses are discontinuous, so that the understandability of a program is influenced. In addition, with the concept of logical addresses, virtual memory technology can be used.
In detail, data is stored in a physical memory, a virtual memory is used during program operation, and data and codes are accessed through a virtual memory address, so that a logical address must be converted into a linear address through conversion, and the linear address is converted into a physical address through mapping again, so that the real physical memory can be accessed.
In embodiments of the present invention, the strings include, but are not limited to, json and xml. For example: the java object is converted into a json character string, and the java object needs to be converted into the json object first, and then the json object needs to be converted into the json character string.
In detail, the converting the encapsulated object into a character string for storage includes: converting the data packet into a data frame; converting the data frame into a character string; and storing the character string into a preset data storage area through the acquired data transmission connection, and taking the stored character string as the storage information.
Further, the conversion of the data packet into the data frame means that a data frame is formed by adding a protocol header and a protocol trailer of the data link layer after the data packet reaches the data link layer, a frame header is added at the front part of each frame, a frame trailer is added at the end of each frame, and the data packet of the network layer is used as the data part of the frame to form a complete frame; the data frame is converted into the character string by adopting a method of specifying a data type when data is read, and a conversion function and the like can be utilized.
In detail, the data frame is a transmission unit of a data link layer. It adds a head and a tail to the data from the upper layer to form a data frame. In a network, network devices group "bits" into individual bytes, which are then "packed" into data frames for transmission over the network. In ethernet data transmission, there is a possibility that a node will encounter a collision within a certain time after sending data due to non-real-time nature of transmission.
In detail, the data storage area may include physical storage devices such as a hard disk of a computer, various storage cards, and a memory of a mobile phone, or currently popular cloud storage devices such as Baidu cloud, Neiyun cloud, and Alice cloud.
In the embodiment of the present invention, the preset storage information is storage information obtained by encapsulating the obtained user information to obtain an encapsulated object, and converting the encapsulated object into a character stream for storage;
in the embodiment of the invention, the user ID is an identification number of the user identity and is used for identifying a user theme in a system. The ID is the abbreviation of various special words such as ID card identification number, account number, unique code, exclusive number, industrial design, national abbreviation, legal word, general account, decoder, software company and the like. For example: the product id is a product number, which is composed of numbers and has uniqueness as with an identification number, and belongs to a part of a product link. The mobile phone ID number is IMEI, is an abbreviation of international mobile equipment identity code, and is an electronic serial number formed by 15 digits.
In this embodiment of the present invention, the reading out the user information of the target user from the stored information according to the user ID includes:
s31, acquiring the index of the stored information by using a preset index function;
and S32, searching in the index by using the user ID, and collecting the searched information as the user information of the target user.
In detail, the preset index function may be a CREATEINDEX function in an SQL library. In MySQL, the CREATE INDEX statement may CREATE an INDEX over an existing table. For example,
the INDEX name, table name, and column name are determined after the CREATE INDEX statement, and the INDEX of the stored information is obtained so that INDEX _ name is the designated INDEX name, and a table can CREATE multiple indexes, but each INDEX has a unique name in the table. table _ name is a name of a data table used for storing the user information in the data storage, and column _ name is a name of a data column used for storing the user information in the data table, which needs to create an index.
And S5, writing the user information into the target access thread in a cache loading mode.
In this embodiment of the present invention, the writing the user information into the target access thread in a cache loading manner includes: creating a data cache in the target access thread; and decoding the user information, and loading the decoded user information into the data cache.
In detail, the thread is the smallest unit that the operating system can perform operation scheduling, is included in the process, and is the actual operation unit in the process.
In this embodiment of the present invention, the loading the decoded user information into the data cache includes: reading data from the data cache to load the data into a data slider of a memory; the total number of data entries in the data slider is kept at a preset number; and repeatedly utilizing the user interface controls with the preset number to sequentially display the data in the data slider in the target access thread.
Specifically, the memory temporarily stores operation data in the CPU and data exchanged with an external memory such as a hard disk. The computer is a bridge for communicating an external memory with a CPU, all programs in the computer are operated in the internal memory, and the level of the overall performance of the computer is influenced by the strength of the internal memory; the data slider is used for collecting digital user data, so that digital input can be better visualized.
In detail, the predetermined number is set to be much smaller than the total number of data in the data cache.
In the embodiment of the invention, the login instruction of the target user is acquired, the target access thread of the target user is analyzed by using the login instruction, the ID is traced to obtain the user information, and the user information is written into the target access thread, so that the system access step is omitted, and the user information is more conveniently loaded.
Fig. 4 is a functional block diagram of a user information loading apparatus according to an embodiment of the present invention.
The user information loading apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the user information loading apparatus 100 may include an instruction parsing module 101, a reflection operation module 102, an information tracing module 103, an information reading module 104, and an information loading module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the instruction analysis module is used for analyzing a target access thread of a target user from a login instruction when the login instruction of the target user is received;
the reflection operation module is used for extracting a request head in the login instruction through reflection operation;
the information tracing module is used for carrying out ID tracing on the request head to obtain a user ID;
the information reading module reads the user information of the target user from preset storage information according to the user ID;
and the information loading module writes the user information of the target user into the target access thread in a cache loading mode.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a user information loading method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a user information loader, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., executing a user information loader, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as a code of a user information loader, etc., but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Only electronic devices having components are shown, and those skilled in the art will appreciate that the structures shown in the figures do not constitute limitations on the electronic devices, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The user information loader stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, enable:
when a login instruction of a target user is received, analyzing a target access thread of the target user from the login instruction;
extracting a request head in the login instruction through reflection operation;
performing ID tracing on the request header to obtain a user ID;
reading the user information of the target user from the preset storage information according to the user ID;
and writing the user information into the target access thread in a cache loading mode. Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to the drawing, and is not repeated here.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor of an electronic device, implements:
when a login instruction of a target user is received, analyzing a target access thread of the target user from the login instruction;
extracting a request head in the login instruction through reflection operation;
performing ID tracing on the request header to obtain a user ID;
reading the user information of the target user from preset storage information according to the user ID;
and writing the user information into the target access thread in a cache loading mode.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (10)
1. A user information loading method is characterized by comprising the following steps:
when a login instruction of a target user is received, analyzing a target access thread of the target user from the login instruction;
extracting a request head in the login instruction through reflection operation;
performing ID tracing 0 on the request header to obtain a user ID;
reading the user information of the target user from preset storage information according to the user ID;
and writing the user information into the target access thread in a cache loading mode.
2. The method for loading user information according to claim 1, wherein the extracting the target access thread of the target user from the login instruction includes:
converting the login instruction into a text;
performing Hash mapping on the text to obtain a key value of the login instruction;
and analyzing the key value by using a preset instruction analyzer to obtain the user ID and the target access thread of the target user.
3. The method for loading user information according to claim 1, wherein the extracting the request header in the login instruction by reflection operation includes:
traversing and determining a request header data class in the login instruction;
acquiring a reflection object, a reflection construction method, a reflection attribute object and a reflection method object according to the request header data class;
constructing a reflection operation by using the reflection object, the reflection construction method, the reflection attribute object and the reflection method object;
and performing reflection operation on the request head data class to obtain a request head.
4. The method for loading user information according to claim 1, wherein the tracing ID of the request header to obtain the user ID comprises:
constructing a request head extraction statement according to the request head;
executing the request header extraction statement to extract a request message header in the access request;
and acquiring the user ID from the message header by using a preset resolver.
5. The method as claimed in claim 1, wherein the reading out the user information of the target user from the preset storage information according to the user ID comprises:
acquiring the index of the stored information by using a preset index function;
and searching in the index by using the user ID, and collecting the searched information as the user information of the target user.
6. The method according to any one of claims 1 to 5, wherein the writing the user information into the target access thread by cache loading comprises:
creating a data cache in the target access thread;
and decoding the user information, and loading the decoded user information into the data cache.
7. The method as claimed in claim 1, wherein before the step of reading the user information of the target user from the preset storage information according to the user ID, the method further comprises:
acquiring user information, and packaging the user information to obtain a packaged object;
and converting the packaged object into a character string for storage, wherein the character string is used as storage information.
8. A user information loading apparatus, characterized in that the apparatus comprises:
the instruction analysis module is used for analyzing a target access thread of a target user from a login instruction when the login instruction of the target user is received;
the reflection operation module is used for extracting a request head in the login instruction through reflection operation;
the information tracing module is used for carrying out ID tracing on the request head to obtain a user ID;
the information reading module reads the user information of the target user from preset storage information according to the user ID;
and the information loading module writes the user information of the target user into the target access thread in a cache loading mode.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the user information loading method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the user information loading method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210439809.9A CN114817688A (en) | 2022-04-25 | 2022-04-25 | User information loading method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210439809.9A CN114817688A (en) | 2022-04-25 | 2022-04-25 | User information loading method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114817688A true CN114817688A (en) | 2022-07-29 |
Family
ID=82508023
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210439809.9A Pending CN114817688A (en) | 2022-04-25 | 2022-04-25 | User information loading method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114817688A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491466A (en) * | 2018-03-06 | 2018-09-04 | 平安科技(深圳)有限公司 | Electronic device, access instruction information acquisition method and storage medium |
CN112699034A (en) * | 2020-12-30 | 2021-04-23 | 百果园技术(新加坡)有限公司 | Virtual login user construction method, device, equipment and storage medium |
CN113901073A (en) * | 2021-09-24 | 2022-01-07 | 浙江莲荷科技有限公司 | Data processing method, device and storage medium |
-
2022
- 2022-04-25 CN CN202210439809.9A patent/CN114817688A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108491466A (en) * | 2018-03-06 | 2018-09-04 | 平安科技(深圳)有限公司 | Electronic device, access instruction information acquisition method and storage medium |
CN112699034A (en) * | 2020-12-30 | 2021-04-23 | 百果园技术(新加坡)有限公司 | Virtual login user construction method, device, equipment and storage medium |
CN113901073A (en) * | 2021-09-24 | 2022-01-07 | 浙江莲荷科技有限公司 | Data processing method, device and storage medium |
Non-Patent Citations (1)
Title |
---|
鸡排饭是我的: "java项目中,利用redis实现系统用户登录信息的存取方法(一)", pages 1 - 4, Retrieved from the Internet <URL:https://blog.csdn.net/ChickenChops/article/details/116493157> * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111813963B (en) | Knowledge graph construction method and device, electronic equipment and storage medium | |
CN106970820A (en) | Code storage method and code storage | |
CN111177113B (en) | Data migration method, device, computer equipment and storage medium | |
CN110851136A (en) | Data acquisition method and device, electronic equipment and storage medium | |
CN112486490B (en) | Front-end code packaging method and device, electronic equipment and storage medium | |
CN113382017B (en) | Permission control method and device based on white list, electronic equipment and storage medium | |
CN114185895A (en) | Data import and export method and device, electronic equipment and storage medium | |
CN116089535A (en) | Data synchronization method, device, equipment and storage medium | |
CN113282854A (en) | Data request response method and device, electronic equipment and storage medium | |
CN112702228A (en) | Service current limiting response method and device, electronic equipment and readable storage medium | |
CN114817688A (en) | User information loading method and device, electronic equipment and storage medium | |
CN114816371B (en) | Message processing method, device, equipment and medium | |
CN115827115A (en) | H5 page jump method, device, equipment and storage medium of WeChat applet | |
CN115114297A (en) | Data lightweight storage and search method and device, electronic equipment and storage medium | |
CN114978649A (en) | Information security protection method, device, equipment and medium based on big data | |
CN114942855A (en) | Interface calling method and device, electronic equipment and storage medium | |
CN115033605A (en) | Data query method and device, electronic equipment and storage medium | |
CN114911479A (en) | Interface generation method, device, equipment and storage medium based on configuration | |
CN113342283A (en) | User position information storage method and device, electronic equipment and readable storage medium | |
CN113672483B (en) | Device log storage method and device, electronic device and medium | |
CN115174698B (en) | Market data decoding method, device, equipment and medium based on table entry index | |
CN113438221B (en) | Local end file loading method and device, electronic equipment and medium | |
CN112527753B (en) | DNS analysis record lossless compression method and device, electronic equipment and storage medium | |
CN115080898A (en) | View updating method, device, equipment and medium based on front-end trigger scene | |
CN113657076B (en) | Page operation record table generation 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 |