Method for electronic mall server to search for commodity information, storage medium and server
By building a URL database and using the mean value of field coordinates to judge, the problem of the e-commerce server frequently reading the cache queue and disk in a short period of time is solved, the hit rate is improved, the read operation is reduced, and the stability of the server is ensured.
Patent Information
- Application Number
- CN202310799512.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-06-30
AI Technical Summary
Existing e-commerce mall servers frequently read cache queues and disks to search for product information in a short period of time, resulting in a low hit rate and excessive load, affecting server operation stability.
A URL database is built in the server, and the mean of the field coordinates is used to determine whether the product information is in the cache queue. By comparing the number of field coordinates with the mean, it is decided whether to directly read the disk for search, reducing invalid cache queue searches.
Improves the cache queue hit rate, reduces read operations, and avoids server stability issues caused by a large number of read operations.
Smart Images

Figure CN117290621B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a method, storage medium and server for searching commodity information on an electronic shopping mall server. Background Art
[0002] With the rapid development of internet technology, some e-commerce companies are integrating product information from a vast amount of suppliers and service providers through the internet, building collaborative supply chain platforms. E-commerce companies primarily access product information from these suppliers and service providers through e-commerce clients. This requires tens of thousands of pieces of product information, representing a massive amount of data. To improve response speeds for data requests, existing servers typically cache frequently used data in a cache queue. This allows data to be directly retrieved from the cache queue and fed back to the data requester, eliminating the need to read data from the server's underlying disk, resulting in faster response times. Similarly, existing e-commerce servers store frequently used product information in a cache queue. When a server receives a product information request from an e-commerce client, it first checks the cache queue to see if the requested product information exists. If so, it feeds the requested product information back to the e-commerce client. If not, it then reads the disk to find the requested product information and feeds it back to the client. Because the server searches for each product information by first reading the cache queue and then reading the disk if it can't find the information, e-commerce companies building internet supply chain collaboration platforms often request massive amounts of product information from the e-commerce server in a short period of time. Much of this information isn't stored in the cache queue, so the e-commerce server can't find it by reading the cache queue. Therefore, when the e-commerce server reads the cache queue, it's highly likely it won't find the target product information, meaning the hit rate is low. If the target product information isn't found, a disk read is required. Consequently, the e-commerce server will have to perform two read operations on the target product information for a large number of product information requests within a short period of time. This means the server has to perform a large number of read operations in a short period of time, which puts a heavy load on the e-commerce server and can easily affect its operational stability. Summary of the Invention
[0003] The purpose of the present invention is to provide a method for an electronic mall server to search for product information, a computer-readable storage medium storing a computer program that implements the method when executed, and an electronic mall server. The method can improve the hit rate of the electronic mall server's read cache queue, reduce the read operations of the electronic mall server to search for product information, and avoid affecting the operating stability of the electronic mall server due to performing a large number of read operations in a short period of time.
[0004] To achieve the above-mentioned object, the present invention provides a method for an electronic mall server to search for product information. The server stores all product information of the electronic mall on a disk and stores some product information in a cache queue so as to quickly read the product information and feed it back to the electronic mall client. The method includes the following steps:
[0005] P. Split the URL of each product information stored in the cache queue into multiple fields according to preset rules, and store each field and its field position in the corresponding URL as a field coordinate in the URL database;
[0006] A. If a product information acquisition request is received, the URL of the target product information to be acquired by the request is split into multiple fields, and each field and its field position in the URL are used as a field coordinate;
[0007] B. For each field coordinate of the target product information URL, obtain the number X of field coordinates that are identical to the field coordinate and the field mean corresponding to the field position of the field coordinate from the URL database The field mean X is the quotient obtained by dividing the total number of field coordinates containing the field position in the URL database Sum by the number of field coordinate types containing the field position N;
[0008] C. If the number X of field coordinates in the URL of the target product information is less than the mean value corresponding to its field position The target product information is searched directly from the server disk instead of reading the cache queue.
[0009] Furthermore, in step C, if the number X of each field coordinate of the target product information URL is greater than the mean value corresponding to its field position Then read the cache queue to find the target product information.
[0010] Further:
[0011] In step P, all field coordinates are retrieved from the URL database, and duplicates are removed from these field coordinates. Each field coordinate after duplicate removal is used as a counting field coordinate, and the number of each counting field coordinate in the URL database is calculated, and the number of each counting field coordinate is stored in the URL database.
[0012] Step B specifically searches the URL database for the same counting field coordinates as the field coordinates of each URL of the target product information, and uses the number of the counting field coordinates as the number X.
[0013] Further:
[0014] In step P, the mean value of each field position in a URL is calculated. And store it in the database;
[0015] Step B specifically searches the URL database for the field mean of the field coordinates of each URL of the target product information.
[0016] Furthermore, in step P, the position of the field is represented by the number of the field in the corresponding URL.
[0017] Furthermore, in step P, the preset rule is specifically a format rule of the URL.
[0018] Furthermore, in step P, a hash value of each field is calculated, specifically using the hash value of the field and the field position of the field in the corresponding URL as a field coordinate.
[0019] The present invention also provides a computer-readable storage medium on which an executable computer program is stored. When the computer program is executed, the method for searching for product information on the electronic shopping mall server as described above is implemented.
[0020] The present invention also provides an electronic mall server, including a processor and a computer-readable storage medium, the computer-readable storage medium is the computer-readable storage medium described above, and the processor executes the computer program of the storage medium to thereby implement the method for the electronic mall server to search for product information as described above.
[0021] The present invention constructs a URL database through step P, and uses this database as the basis for determining whether the target product information requested is already stored in the cache queue. The present invention considers that if, in order to achieve accurate judgment results, each field coordinate of the URL of the target product information requested is compared one-by-one with each field coordinate of each URL in the URL database to determine whether the URL of the target product information belongs to the URL of the product information in the cache queue, the large number of URLs in the URL database would result in a very large amount of data to be compared, which would not be worth the effort. Therefore, the present invention does not adopt the method of comparing each field coordinate of the target product information URL with each URL in the URL database one-by-one. Instead, it uses the number of field coordinates in the URL database that are identical to the target product information URL to infer whether the target product information URL belongs to the URL of the product information in the cache queue. Specifically, the URL database stores the field coordinates of the URLs of all product information in the cache queue. Different product information URLs may have the same field coordinates. The more field coordinates of the target product information URL that are identical in the URL database, the more URLs in the URL database that are similar to the target product information URL, and the higher the probability that the target product information URL belongs to the URL of the product information in the cache queue. The present invention uses this idea to infer whether the URL of the target product information belongs to the URL of the product information in the cache queue. But how many URLs does it take to determine that the target product information URL belongs to the URL of the product information in the cache queue? The present invention uses the field mean value corresponding to the field position of each field coordinate of the target product information. As the number benchmark of the field coordinates, if the number X of the same field coordinates of each field coordinate of the target product information URL in the URL database is greater than the field mean corresponding to its field position It is considered that the target product information is likely to be stored in the cache queue; on the contrary, if the URL of the target product information has the same field coordinates in the URL database, the number X is less than the field mean corresponding to its field position It is considered that the probability of the target product information being stored in the cache queue is lower than that of being stored on the disk. Based on this principle, the present invention obtains the number X of field coordinates identical to the field coordinates and the field mean X corresponding to the field position of the field coordinates from the URL database in step B, and then executes step C. If the number X of field coordinates identical to the field coordinates in the URL database for the target product information URL is less than the field mean X corresponding to the field position, If the target commodity information is not in the cache queue, the server directly reads the target commodity information from the disk. In this way, compared with the uniform priority reading cache queue, the present application reduces the number of times of reading the cache queue to find the commodity information but no hit, improves the hit rate of the server reading the cache queue to find the commodity information, reduces the read operation of the electronic mall server to find the commodity information, and avoids the electronic mall server from being affected in running stability due to a large number of read operations performed in a short time. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 is a flow diagram of the method of the electronic mall server to find the commodity information.
[0023] Figure 2 is a schematic diagram of the communication connection between the electronic mall server and the mobile phone. DETAILED DESCRIPTION
[0024] The present application will be further described in detail below in combination with the specific embodiments.
[0025] The present embodiment provides an electronic mall server, which comprises a processor and a computer readable storage medium, the computer readable storage medium stores an executable computer program, and the processor of the electronic mall server executes the computer program of the storage medium so as to Figure 1 The method of the electronic mall server to find the commodity information. The execution process of the method is described in detail below.
[0026] The e-commerce server stores all the product information of the e-commerce mall on disk, and stores some product information in a cache queue so that the product information can be quickly read and fed back to the e-commerce client. URLs have specified format rules. A URL includes four pieces of information: protocol, host, port, and path. This is the format rule of the URL itself. The e-commerce server pre-splits the URL of each product information stored in the cache queue into four fields: protocol field, host field, port field, and path field according to the URL format rules (i.e., preset rules), and numbers the fields according to the order of these four fields in the URL. The number represents the position of the field in the URL to which it belongs, and then stores each field and its field position in the URL to which it belongs as a field coordinate in the URL database. The e-commerce server extracts all field coordinates from the URL database, deduplicates these field coordinates, uses each field coordinate after deduplication as a count field coordinate, and calculates the number of each count field coordinate in the URL database, and stores the number of each count field coordinate in the URL database. In this embodiment, the field positions included in each URL are the same. For each field position in a URL, the e-commerce server counts the total number of field coordinates containing the field position in the URL database (Sum), and counts the number of field coordinate types N containing the field position in the URL database (different field information means different field coordinate types), and calculates the field mean of the field position accordingly. The average value of each field position Stored in the database.
[0027] like Figure 2 As shown, the user can connect to the e-commerce mall server through a mobile terminal such as a mobile phone. Specifically, the user logs in to the e-commerce mall on the mobile phone, and then clicks on the product details link on the e-commerce mall to trigger a product information acquisition request. If the e-commerce mall server receives a product information acquisition request, it splits the URL of the target product information to be acquired by the request into multiple fields, and takes each field and its field position in the URL as a field coordinate. For each field coordinate of the URL of the target product information, the e-commerce mall server searches the URL database for the number X of counting field coordinates that are the same as the field coordinate and the field mean X corresponding to the field position of the field coordinate. The e-commerce mall server compares the number X of field coordinates of the URL of the target product information with the field mean corresponding to the field position of the field coordinate one by one. If the number X of the currently compared field coordinates is less than the field mean corresponding to its field position According to the above product information acquisition request, the cache queue is skipped and the server disk is directly read to find the target product information, and then the target product information found is fed back to the user's mobile phone. If the number of fields currently compared X is greater than the field mean corresponding to its field position Then continue to compare the number X of the next field coordinates and the field mean corresponding to its field position If the number X of all field coordinates in the target product information URL is greater than the field mean corresponding to its field position The cache queue is then read according to the product information acquisition request to search for the target product information. If the target product information is found in the cache queue, it is fed back to the user's mobile phone. Otherwise, the server disk is read to search for the target product information and then fed back to the user's mobile phone. Compared to a unified priority read cache queue approach, this invention reduces the number of times the cache queue is read but no hit is found, improves the server's hit rate for searching for product information in the cache queue, reduces the number of read operations required by the e-commerce server to search for product information, and avoids the e-commerce server's operational stability being affected by performing a large number of read operations in a short period of time.
[0028] In this embodiment, each field (the data information contained in the field) and its field position in the URL are used as a field coordinate. Since the protocol field, host field, port field, and path field in the URL each contain a relatively large amount of data information, it would be troublesome and time-consuming for the e-commerce server to search the URL database for the counting field coordinates that are the same as the field coordinates of the URL of the target product information according to the data information contained in the field itself and its field position. Preferably, other embodiments calculate the hash value of each field after splitting the multiple fields of the URL of each product information in the cache queue, specifically using the hash value of the field and the field position of the field in the corresponding URL as a field coordinate. The amount of data of the hash value of the field is less than the amount of data information it contains. Therefore, it is relatively faster for the e-commerce server to search the URL database for the counting field coordinates that are the same as the field coordinates of the URL of the target product information according to the hash value of the field and its field position.
[0029] The above is only an embodiment of the present invention and does not limit the scope of patent protection. Those skilled in the art can make non-substantial changes or substitutions based on the present invention and still fall within the scope of patent protection.
Claims
1. A method for searching product information on an e-commerce server. The server stores all product information on the e-commerce server on disk and stores some product information in a cache queue so as to quickly read the product information and feed it back to the e-commerce client. The method is characterized by: This method comprises the following steps: P. Split the URL of each product information stored in the cache queue into multiple fields according to preset rules, and store each field and its field position in the corresponding URL as a field coordinate in the URL database; A. If a product information acquisition request is received, the URL of the target product information to be acquired by the request is split into multiple fields, and each field and its field position in the URL are used as a field coordinate; B. For each field coordinate of the target product information URL, obtain the number X of field coordinates that are identical to the field coordinate and the field mean corresponding to the field position of the field coordinate from the URL database Among them, the field mean It is the quotient of the total number of field coordinates containing the field position in the URL database (Sum) divided by the number of field coordinate types (N) containing the field position; C. If the number X of field coordinates in the URL of the target product information is less than the mean value corresponding to its field position The target product information is searched directly from the server disk instead of reading the cache queue.
2. The method for searching product information on an electronic shopping mall server according to claim 1, wherein: In step C, if the number X of each field coordinate of the target product information URL is greater than the mean value corresponding to its field position Then read the cache queue to find the target product information.
3. The method for searching product information on an electronic shopping mall server according to claim 1, wherein: In step P, all field coordinates are retrieved from the URL database, and duplicates are removed from these field coordinates. Each field coordinate after duplicate removal is used as a counting field coordinate, and the number of each counting field coordinate in the URL database is calculated respectively, and the number of each counting field coordinate is stored in the URL database; Step B specifically searches the URL database for the same counting field coordinates as the field coordinates of each URL of the target product information, and uses the number of the counting field coordinates as the number X.
4. The method for searching product information on an electronic shopping mall server according to claim 3, wherein: In step P, the mean value of each field position in a URL is calculated. And store it in the database; Step B specifically searches the URL database for the field mean of the field coordinates of each URL of the target product information.
5. The method for searching product information on an electronic shopping mall server according to claim 1, wherein: In step P, the position of the field is represented by the number of the field in the corresponding URL.
6. The method for searching product information by an electronic shopping mall server according to claim 1, wherein: In step P, the preset rule is specifically a format rule of URL.
7. The method for searching product information on an electronic shopping mall server according to claim 1, wherein: In step P, a hash value of each field is calculated, specifically using the hash value of the field and the field position of the field in the corresponding URL as a field coordinate.
8. A computer-readable storage medium having an executable computer program stored thereon, characterized in that: When the computer program is executed, the method for searching product information on an electronic shopping mall server according to any one of claims 1 to 7 is implemented.
9. An electronic shopping mall server, comprising a processor and a computer-readable storage medium, characterized in that: The computer-readable storage medium is the computer-readable storage medium according to claim 8, and the processor executes the computer program of the storage medium to thereby provide the method for an electronic shopping mall server to search for product information according to any one of claims 1 to 7.
Citation Information
Patent Citations
Picture acquisition method and device, and client
CN111104528A
Systems, methods, and devices to map and / or provide an interface to a distributed ledger
WO2023107482A1