Website internal link generation method and device, as well as storage medium and electronic device

By randomly selecting data numbers in the data numbering interval and verifying their uniqueness, generating website internal links, the problem of low manual configuration efficiency under big data sources is solved, and efficient and cost-saving internal link generation is achieved.

CN114969581BActive Publication Date: 2025-07-08BEIJING JINTI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210246070.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2025-07-08
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

In the prior art, when facing large orders of magnitude data sources, the optimization efficiency of the website's internal links through manual configuration is low, slow to run, and random acquisition of data sources leads to an increase in system resource consumption, affecting data reading of other services.

Method used

The data number is randomly extracted in the preset data number interval, and the data structure is a bit storage structure to be verified objects, and saved to the object storage space after verification is not repeated. The internal link is generated based on the data number to avoid repeated acquisition of the data source.

Benefits of technology

It improves the efficiency of internal link generation, saves storage space and hardware costs, reduces database pressure, enhances the scalability of the solution, and avoids the reading pressure of duplicate data sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114969581B_ABST
    Figure CN114969581B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention discloses a method and device for generating internal links within a website, as well as a storage medium and an electronic device. The method generates a to-be-verified object with a bit storage structure by extracting N data numbers from N pre-set data number intervals; when the to-be-verified object is not repeated with the objects that have been verified in the object storage space, the to-be-verified object is saved as a verified object to the object storage space; N corresponding data sources are respectively retrieved in the data source storage space according to the extracted N data numbers, and N internal link links displayed in a single website page are generated. This embodiment avoids randomly obtaining data from the data source, reduces the pressure on the database storing the data source; by simply allocating data numbers and verifying the repeatability of the data numbers to adapt to larger data volumes, the efficiency of internal link generation is improved, and the scalability of the solution is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer information processing, and in particular to a method and device for generating internal links within a website, as well as a storage medium and an electronic device. Background Art

[0002] Internal links are mutual links between content pages under the same website domain name, that is, the content of one's own website is linked to the internal pages of one's own website, also known as in-site links. A reasonable setting of internal links within a website can improve the inclusion of search engines and the weight of the website. Among them, ensuring that the internal links displayed on each page of the website are different is an effective means of internal link optimization. However, in the prior art, there is a problem of high repetition of internal links on web pages, specifically reflected in that the internal links displayed on pages of the same category are the same and rarely updated. Even when updated, it is mostly through manual configuration and placement. When the data source magnitude is small, in order to achieve different internal links for page display, manual configuration can still be achieved. However, when the data source magnitude is too large, there will be two problems in implementing internal link update and optimization through manual configuration. One is that conventional random acquisition of data sources consumes resources and runs slowly, and it will block other services from reading the data source. The other is that if the randomly acquired internal link is repeated with the internal links of other pages, the process of randomly acquiring the data source needs to be repeated, which will further accelerate the consumption of system resources and reduce the running speed. Therefore, how to effectively optimize the internal links of a website, which can not only achieve non-repetitive internal links for page display, improve the search weight of a single page, but also improve the efficiency of internal link generation, has become an urgent technical problem to be solved. Summary of the Invention

[0003] In order to solve the technical problems of low efficiency and slow operation of internal link optimization of the same website relying on manual configuration in the face of a large number of data sources, the present invention is proposed.

[0004] Embodiments of the present invention provide a method and device for generating internal links within a website, as well as a storage medium and an electronic device.

[0005] According to one aspect of the embodiments of the present invention, a method for generating internal links within a website is provided, and the method includes:

[0006] Randomly extract 1 data number from each of N pre-set data number intervals, and generate a to-be-verified object with a bit storage structure according to the N extracted data numbers;

[0007] When the to-be-verified object is not repeated with the objects that have been verified in the object storage space, save the to-be-verified object as a verified object to the object storage space;

[0008] Retrieve the corresponding data sources in the data source storage space respectively according to the extracted N data numbers, and generate N internal link URLs displayed on a single website page.

[0009] Optionally, in each of the above method embodiments of the present invention, the generation method of the data number range includes:

[0010] Generate N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting value of the data numbers included in the N data number ranges is 1, and the ending value of the numbering is C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page; or

[0011] Generate N data number ranges according to the number N of data sources displayed on each page of the website. Among them, when the starting value of the data numbers included in the nth data number range is (n - 1)*C + 1 and the ending value of the numbering is n*C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page, and 1 ≤ n ≤ N.

[0012] Optionally, in each of the above method embodiments of the present invention, randomly extract 1 data number from each of the N pre-set data number ranges, and generate an object to be verified with a bit storage structure according to the extracted N data numbers, including:

[0013] In the database redis, store the N data number ranges in a key-value structure. Among them, when the starting value of the N data number ranges is 1 and the ending value of the numbering is C, the key value of each data number range is the number n of the data number range, and the value value is 1; when the starting value of the nth data number range is (n - 1)*C + 1 and the ending value of the numbering is n*C, the key value of the nth data number range is n, and the value value is (n - 1)*C + 1;

[0014] Randomly extract 1 data number from each of the N pre-set data number ranges;

[0015] Combine the extracted N data numbers to generate an object with a bit storage structure as the object to be verified, and save the object to be verified in the form of a java object.

[0016] Optionally, in each of the above method embodiments of the present invention, when the object to be verified is not repeated with the objects that have been verified in the object storage space, saving the object to be verified as a verified object in the object storage space includes:

[0017] When the object storage space is the database redis and it is determined by sismember that the object to be verified does not exist, the object to be verified does not duplicate with the objects already verified in redis, and the object to be verified is stored in redis.

[0018] Optionally, in each of the above method embodiments of the present invention, when the data structure of the object to be verified is a bitset structure, the object to be verified is stored in redis using a set structure.

[0019] Optionally, in each of the above method embodiments of the present invention, generating N in-chain links displayed on a single website page by respectively retrieving corresponding data sources in the data source storage space according to the extracted N data numbers includes:

[0020] Determining N primary key ID values according to the extracted N data numbers;

[0021] Retrieving the corresponding N data sources in the data source storage space according to the N primary key ID values;

[0022] Generating N in-chain links according to the retrieved N data sources.

[0023] Optionally, in each of the above method embodiments of the present invention, the determining N primary key ID values according to the extracted N data numbers includes:

[0024] When the starting value of the data numbers included in the nth data number interval among the N data number intervals is (n - 1)*C + 1 and the ending value is n*C, the values of the N data numbers are the N primary key ID values;

[0025] When the starting value of the data numbers included in the N data number intervals is 1 and the ending value is C, the calculation formula for the nth primary key ID value among the N primary key ID values is:

[0026] ID n =(n - 1)*C + D n

[0027] where 1 ≤ n ≤ N, 1 ≤ D n ≤ C, D n is the value of the data number extracted from the nth data number interval.

[0028] According to another aspect of the embodiments of the present invention, there is provided a website in-chain generation device, and the device includes:

[0029] A data string module, configured to randomly extract one data number from each of N preset data number intervals, and generate a to-be-verified object with a bit storage structure according to the N extracted data numbers;

[0030] A data verification module, configured to save the to-be-verified object as a verified object to the object storage space when the to-be-verified object is not repeated with the objects that have been verified in the object storage space;

[0031] An internal link generation module, configured to respectively retrieve corresponding data sources in the data source storage space according to the N extracted data numbers, and generate N internal link URLs displayed on a single website page.

[0032] Optionally, in each of the above device embodiments of the present invention, the device further includes an interval numbering module, configured to generate N data number intervals, where:

[0033] Generate N data number intervals according to the number N of data sources displayed on each page of the website, where the starting number values of the data numbers included in the N data number intervals are all 1, and the ending number values are all C, and C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page; or

[0034] Generate N data number intervals according to the number N of data sources displayed on each page of the website, where the starting number value of the data numbers included in the nth data number interval is (n - 1)*C + 1, and the ending number value is n*C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page, and 1 ≤ n ≤ N.

[0035] Optionally, in each of the above device embodiments of the present invention, the data string module randomly extracts one data number from each of the N preset data number intervals, and generates a to-be-verified object with a bit storage structure according to the N extracted data numbers, including:

[0036] In the database redis, store the N data number intervals in a key-value structure, where when the starting number values of the N data number intervals are all 1 and the ending number values are all C, the key value of each data number interval is the number n of the data number interval, and the value value is 1; when the starting number value of the nth data number interval is (n - 1)*C + 1 and the ending number value is n*C, the key value of the nth data number interval is n, and the value value is (n - 1)*C + 1;

[0037] Randomly extract one data number from each of the N preset data number intervals;

[0038] Combine the extracted N data numbers, generate an object with a bit storage structure as the object to be verified, and save the object to be verified in the form of a Java object.

[0039] Optionally, in the above device embodiments of the present invention, when the object to be verified in the data verification module is not repeated with the objects that have passed verification in the object storage space, saving the object to be verified as a verified object to the object storage space includes:

[0040] When the object storage space is the Redis database, if it is determined by sismember that the object to be verified does not exist, then the object to be verified is not repeated with the objects that have passed verification in Redis, and the object to be verified is stored in Redis.

[0041] Optionally, in the above device embodiments of the present invention, when the data structure of the object to be verified in the data string module is a bitset structure, the data verification module stores the object to be verified in Redis using a set structure.

[0042] Optionally, in the above device embodiments of the present invention, the internal link generation module includes:

[0043] An ID determination unit for determining N primary key ID values according to the extracted N data numbers;

[0044] A data retrieval unit for retrieving corresponding N data sources from the data source storage space according to the N primary key ID values;

[0045] An internal link generation unit for generating N internal link URLs according to the retrieved N data sources.

[0046] Optionally, in the above device embodiments of the present invention, the ID determination unit determines N primary key ID values according to the extracted N data numbers, including:

[0047] When the starting value of the data numbers included in the nth data number range among the N data number ranges is (n - 1)*C + 1 and the ending value of the numbering is n*C, the values of the N data numbers are the N primary key ID values;

[0048] When the starting value of the data numbers included in the N data number ranges is 1 and the ending value of the numbering is C, the calculation formula for the nth primary key ID value among the N primary key ID values is:

[0049] ID n =(n - 1)*C + D n

[0050] where 1 ≤ n ≤ N, 1 ≤ D n≤C, where n is the key value of the data number range, D n is the data number value extracted from the nth data number range.

[0051] According to another aspect of the embodiments of the present invention, there is provided a computer-readable storage medium storing a computer program for executing the method according to any one of the above embodiments of the present invention.

[0052] According to another aspect of the embodiments of the present invention, there is provided an electronic device, which includes:

[0053] a processor;

[0054] a memory for storing executable instructions of the processor;

[0055] The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any one of the above embodiments of the present invention.

[0056] Based on the website internal link generation method and device, as well as the storage medium and electronic device provided in the above embodiments of the present invention, the method includes: when facing a large number of data sources, randomly extracting 1 data number from each of the N pre-set data number ranges, and generating a to-be-verified object with a bit storage structure based on the N extracted data numbers; when the to-be-verified object is not repeated with the objects that have been verified in the object storage space, saving the to-be-verified object as a verified object to the object storage space; respectively retrieving the corresponding data sources in the data source storage space according to the N extracted data numbers, and generating N internal link links displayed on a single website page. The technical effects of the website internal link generation method and device, as well as the storage medium and electronic device in this embodiment include:

[0057] 1. It avoids randomly obtaining data from the data source. Instead, it first generates data number ranges, verifies the repeatability of data numbers by extracting data numbers in the data number ranges, and only generates internal links and then obtains the data source when the data numbers are verified to be non-repeated. It avoids storing a large number of exhaustive results of page displays to achieve different random display contents for each page, greatly saving storage space, reducing the pressure on the database storing the data source, and thus not having to specifically select a high-performance server, saving hardware costs.

[0058] 2. By simply allocating data numbers and verifying the repeatability of data numbers to adapt to larger data volumes, without having to regenerate the technical solution for internal link optimization, it greatly enhances the scalability of the solution.

[0059] 3. When designing the scheme for allocating data numbers, the data divide-and-conquer strategy is used to divide the data numbers into multiple intervals, and one data number is randomly selected from multiple intervals, thereby reducing the amount of data to be scanned and improving the efficiency of internal link generation.

[0060] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] By describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings, the above and other objects, features, and advantages of the present invention will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0062] Figure 1 is a flowchart of a method for generating internal links of a website provided by an exemplary embodiment of the present invention;

[0063] Figure 2 is a schematic structural diagram of a data number interval provided by an exemplary embodiment of the present invention;

[0064] Figure 3 is a schematic structural diagram of a data number interval provided by another exemplary embodiment of the present invention;

[0065] Figure 4 is a schematic structural diagram of storing an object to be verified in an object storage space provided by an exemplary embodiment of the present invention;

[0066] Figure 5 is a schematic structural diagram of a device for generating internal links of a website provided by an exemplary embodiment of the present invention;

[0067] Figure 6 is the structure of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0068] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments of the present invention. It should be understood that the present invention is not limited by the exemplary embodiments described herein.

[0069] It should be noted that: unless otherwise specifically stated, the relative arrangements, numerical expressions, and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present invention.

[0070] Those skilled in the art can understand that terms such as "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate an inevitable logical order between them.

[0071] It should also be understood that in the embodiments of the present invention, "a plurality of" may refer to two or more, and "at least one" may refer to one, two or more.

[0072] It should also be understood that for any component, data or structure mentioned in the embodiments of the present invention, without clear limitation or contrary indication in the context, it can generally be understood as one or more.

[0073] In addition, the term "and / or" in the present invention is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present invention generally represents an "or" relationship between the associated objects before and after.

[0074] It should also be understood that the present invention emphasizes the differences between various embodiments. Their similarities or similarities can be referred to each other. For the sake of brevity, they will not be elaborated one by one.

[0075] At the same time, it should be understood that for the convenience of description, the dimensions of each part shown in the drawings are not drawn according to the actual proportional relationship.

[0076] The following description of at least one exemplary embodiment is actually only illustrative and in no way a limitation on the present invention and its application or use.

[0077] Technologies, methods and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods and devices should be regarded as part of the specification.

[0078] It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0079] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate together with many other general-purpose or special-purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.

[0080] Terminal devices, computer systems, servers and other electronic devices can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment, where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0081] Exemplary method

[0082] Figure 1 It is a schematic flowchart of a method for generating internal links within a website provided by an exemplary embodiment of the present invention. This embodiment can be applied to an electronic device, such as Figure 1 As shown, the method for generating internal links within a website in this embodiment includes the following steps:

[0083] Step 101, randomly select 1 data number in each of the N pre-set data number intervals, and generate a to-be-verified object with a bit storage structure according to the N data numbers extracted.

[0084] Preferably, the generation method of the data number interval includes:

[0085] Generate N data number intervals according to the number N of data sources displayed on each page of the website, where the starting value of the data numbers included in the N data number intervals is 1, and the ending value of the number is C, and C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page; or

[0086] Generate N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting value of the data numbers included in the nth data number range is (n - 1)*C + 1, and the ending value of the data numbers is n*C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page, and 1 ≤ n ≤ N.

[0087] In one embodiment, assume that the data sources to be displayed on the website page are company information, and its magnitude is in the millions, while the number N of companies that can be displayed on each page is 20. Then the data source storage space will be divided into 20 buckets, and the 20 buckets are numbered from 1 to 20. The data source storage space can be a MySQL database. In the database, for data sources in the millions, when storing the data sources in the order of the buckets, the primary key ID value of each data source is automatically generated, and its value range is from 1 to 1,000,000.

[0088] Furthermore, according to 1,000,000 / 20 = 50,000, it can be known that the value of c is 50,000, that is, 1 million data sources are stored in 20 buckets, and each bucket can store 50,000 data sources. Therefore, there are two ways to generate data number ranges: one is that the starting values of the data numbers included in the 20 data number ranges are all 1, and the ending values are all 50,000; the other is that in the 20 data number ranges, the starting value of the data numbers included in the nth number range is (n - 1)*C + 1, and the ending value is n*C, that is, the 20 data number ranges are (1, 50,000), (50,001, 100,000), …… (950,001, 1,000,000) in sequence.

[0089] Preferably, randomly select 1 data number from each of the N pre-set data number ranges, and generate a verification object with a bit storage structure according to the N data numbers selected, including:

[0090] In the database redis, use the key-value structure to store the N data number ranges. Among them, when the starting values of the data numbers included in the N data number ranges are all 1 and the ending values are all C, the key value of each data number range is the number n of the data number range, and the value value is 1; when the starting value of the data numbers included in the nth data number range is (n - 1)*C + 1 and the ending value is n*C, the key value of the nth data number range is n, and the value value is (n - 1)*C + 1;

[0091] Randomly select 1 data number from each of the N pre-set data number ranges;

[0092] Combine the extracted N data numbers, generate an object with a bit storage structure as the object to be verified, and save the object to be verified in the form of a Java object.

[0093] Figure 2 It is a schematic structural diagram of the data number range provided by an exemplary embodiment of the present invention. As Figure 2 shown, in one embodiment, 20 data number ranges are successively (1, 50000), (50001, 100000), …… (950001, 1000000). Then when the 20 data number ranges are stored in the database redis in a key-value structure, the key values of the data number ranges are successively bucket numbers 1 to 20, and the value values corresponding to each data number range are successively 1, 50001, ……, 950001. Storing data numbers in a key-value structure only requires storing the number of each storage range and the data number of the data source with the position number 1 in each storage range to determine the range of data numbers in each data number range, greatly saving storage space and improving the efficiency of data processing. In addition, the data structure of the object to be verified is a bit storage structure, which can ensure that more data is stored in the same storage space, and also plays the role of saving storage space and improving data processing efficiency.

[0094] Figure 3 It is a schematic structural diagram of the data number range provided by another exemplary embodiment of the present invention. As Figure 3 shown, in another embodiment, 20 data number ranges are all (1, 50000). Then when the 20 data number ranges are stored in the database redis in a key-value structure, the key values of the data number ranges are still successively bucket numbers 1 to 20, and the value values corresponding to each data number range are all 1. Compared with the Figure 2 embodiment, the 20 data number ranges in this embodiment are exactly the same, and are the same as the first data number range in the Figure 2 embodiment. Since the numerical values of the data numbers included in this data number range are smaller than those of the data numbers included in other data number ranges, more data storage space can be saved. Moreover, when the data structure of the object to be verified is a bit storage structure, since the value of the data number is small, the data storage space occupied by the combination of data numbers is also smaller, so that it can be further ensured that more data is stored in the same data storage space compared with the Figure 2 embodiment, and the data storage space is better saved.

[0095] Step 102, when the object to be verified is not repeated with the objects that have been verified in the object storage space, save the object to be verified as a verified object to the object storage space.

[0096] Preferably, when the object to be verified is not repeated with the objects that have been verified in the object storage space, saving the object to be verified as a verified object to the object storage space includes:

[0097] When the object storage space is the database redis, and it is determined by sismember that the object to be verified does not exist, then the object to be verified is not repeated with the objects that have been verified in redis, and the object to be verified is stored in redis.

[0098] Preferably, when the data structure of the object to be verified is a bitset structure, the object to be verified is stored in redis using a set structure.

[0099] It should be noted by those skilled in the art that there are many implementation methods for verifying whether data objects are repeated. For example, using bloomfilter can also achieve it. This example only provides one possibility.

[0100] Figure 4 It is a schematic structural diagram of storing the object to be verified into the object storage space provided by an exemplary embodiment of the present invention. As Figure 4 shown, in the above embodiment, when the data structure of the object to be verified obtained by combining the data numbers randomly selected from 20 data number intervals is a bitset structure, when it is determined by sismember in redis that the object to be verified does not exist, the object to be verified stored in the bitset structure is stored in redis using a set structure because the data stored in the set structure will not be repeated. When it is determined by sismember that the object to be verified exists, it means that the object to be verified is repeated with the objects in the object storage space, and then a new object to be verified needs to be generated by respectively extracting 1 data number from 20 data number intervals again, and then it is determined again by sismember in redis whether the new verified object exists. After exhaustive enumeration according to this embodiment, the last non-repeated verified object is bitsetn.

[0101] Step 103, respectively retrieve the corresponding data sources in the data source storage space according to the N data numbers extracted, and generate N internal link links displayed on a single website page.

[0102] Preferably, respectively retrieving the corresponding data sources in the data source storage space according to the N data numbers extracted, and generating N internal link links displayed on a single website page includes:

[0103] Generate N primary key ID values according to the extracted N data numbers;

[0104] Retrieve the corresponding N data sources in the data source storage space according to the N primary key ID values;

[0105] Generate N internal link URLs according to the retrieved N data sources.

[0106] Preferably, in each of the above method embodiments of the present invention, determining N primary key ID values according to the extracted N data numbers includes:

[0107] When the starting number value of the data numbers included in the nth data number interval among the N data number intervals is B [(n-1)*c+1] , and the ending number value is B nC , the values of the N data numbers are the N primary key ID values;

[0108] When the starting number values of the data numbers included in the N data number intervals are all 1 and the ending number values are all C, the calculation formula for the nth primary key ID value among the N primary key ID values is:

[0109] ID n =(n - 1)*C + D n

[0110] where 1≤n≤N, 1≤D n ≤C, n is the key value of the data number interval, and D n is the value of the data number extracted from the nth data number interval.

[0111] In one embodiment, for an object that passes the verification, traverse the stream in its corresponding bitset structure to obtain 20 data numbers. When all 20 data numbers are in the interval (1, 50000), calculate the primary key ID value through the data number and the key value of the data number interval, and retrieve the data source corresponding to the data number in 20 storage intervals, such as select company_id, company_name from datasource where id in(1,50001,100001…,950001). Assume that the data number values in the 20 storage intervals are 1, 50001, 100001…, 950001 respectively. Then, according to the instruction, 20 internal links and the text corresponding to the internal links of a single page can be generated by calling the stored company information. Examples of internal links are as follows:

[0112] <a href=”http: tianyancha.com company xxx”>xxx

[0113] Among them, the website domain name that can display company information is http: / / tianyancha.com, and company / xxx is the called company name.

[0114] As can be seen from the above embodiments, in this application, the invocation of the data source is separated from the generation of the data source internal link. According to the number N of data sources that can be displayed on a single website page and the magnitude of the data source, a data number range is generated. Then, the generated non-repeating website internal link is used to verify whether the data numbers of the data sources displayed on a single page are repeated. Only when they are not repeated, the stored data source is invoked to generate the internal link and the corresponding text. This not only avoids the pressure on the database caused by a large number of repeated reads of the data source, saves hardware costs, but also for data sources of different magnitudes, only a few parameters such as the magnitude of the data source and the number of data sources displayed on a single page in this application need to be conveniently modified to achieve the update of the technical solution, making this application have excellent scalability.

[0115] Exemplary device

[0116] Figure 5 It is a schematic structural diagram of a website internal link generation device provided by an exemplary embodiment of the present invention. As Figure 5 shown, the website internal link generation device in this embodiment includes:

[0117] A data string module 501, configured to randomly extract 1 data number from each of the N pre-set data number ranges, and generate a to-be-verified object with a bit storage structure according to the N extracted data numbers.

[0118] A data verification module 502, configured to save the to-be-verified object as a verified object to the object storage space when the to-be-verified object is not repeated with the objects that have been verified in the object storage space.

[0119] An internal link generation module 503, configured to respectively retrieve the corresponding data sources in the data source storage space according to the N extracted data numbers, and generate N internal link links displayed on a single website page.

[0120] Preferably, the device further includes an interval numbering module, configured to generate N data number ranges, where:

[0121] Generate N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting value of the data numbers included in the N data number ranges is 1, and the ending value of the numbering is C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page; or

[0122] Generate N data number intervals according to the number N of data sources displayed on each page of the website. Among them, the starting value of the data numbers included in the nth data number interval is (n - 1)*C + 1, and the ending value of the number is n*C. Here, C is calculated based on the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page, where 1 ≤ n ≤ N.

[0123] Preferably, the data string module randomly selects 1 data number from each of the N pre-set data number intervals, and the to-be-verified object with a bit storage structure generated according to the N data numbers selected includes:

[0124] In the database redis, store the N data number intervals in a key-value structure. Among them, when the starting values of the N data number intervals are all 1 and the ending values are all C, the key value of each data number interval is the number n of the data number interval, and the value value is 1; when the starting value of the nth data number interval is (n - 1)*C + 1 and the ending value is n*C, the key value of the nth data number interval is the number n of the data number interval, and the value value is (n - 1)*C + 1;

[0125] Randomly select 1 data number from each of the N pre-set data number intervals;

[0126] Combine the N data numbers selected to generate an object with a bit storage structure as the to-be-verified object, and save the to-be-verified object in the form of a java object.

[0127] Preferably, when the to-be-verified object in the data verification module is not repeated with the objects that have passed verification in the object storage space, saving the to-be-verified object as an object that has passed verification to the object storage space includes:

[0128] When the object storage space is the database redis, and it is determined by sismember that the to-be-verified object does not exist, then the to-be-verified object is not repeated with the objects that have passed verification in redis, and store the to-be-verified object in redis.

[0129] Preferably, when the data structure of the to-be-verified object in the data string module is a bitset structure, the data verification module stores the to-be-verified object in redis using a set structure.

[0130] Preferably, the internal link generation module 503 includes:

[0131] An ID determination unit for determining N primary key ID values according to the N data numbers selected;

[0132] A data retrieval unit, configured to retrieve corresponding N data sources in a data source storage space according to N primary key ID values;

[0133] An internal link generation unit, configured to generate N internal link URLs according to the retrieved N data sources.

[0134] Preferably, the ID determination unit determines the N primary key ID values according to the extracted N data numbers, including:

[0135] When the starting value of the data numbers included in the nth data number range among the N data number ranges is (n - 1)*C + 1 and the ending value is n*C, the values of the N data numbers are the N primary key ID values;

[0136] When the starting values of the data numbers included in the N data number ranges are all 1 and the ending values are all C, the calculation formula for the nth primary key ID value among the N primary key ID values is:

[0137] ID n =(n - 1)*C + D n

[0138] where 1 ≤ n ≤ N, 1 ≤ D n ≤ C, n is the key value of the data number range, and D n is the data number value extracted from the nth data number range.

[0139] The website internal link generation device provided in this embodiment generates data number ranges for the data source magnitude and the number of data sources that can be displayed on a single web page, combines the data numbers extracted from the data number ranges to generate objects to be verified, and verifies whether the objects to be verified are repeated. Thus, when the objects to be verified are not repeated, the steps of generating internal links and text for the data source according to the verified objects are the same as those taken by the website internal link generation method provided in this embodiment, and the achieved technical effects are also the same, which will not be elaborated here.

[0140] Exemplary electronic device

[0141] Figure 6 is the structure of an electronic device provided in an exemplary embodiment of the present invention. The electronic device can be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device can communicate with the first device and the second device to receive the input signals collected from them. Figure 6 Illustrates a block diagram of an electronic device according to an embodiment of the present disclosure. As Figure 6 shown, the electronic device includes one or more processors 601 and a memory 602.

[0142] The processor 601 can be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions.

[0143] The memory 602 can include one or more computer program products, and the computer program products can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory can include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory can include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions can be stored on the computer-readable storage media, and the processor 601 can run the program instructions to implement the method of information mining on the historical change records of the software programs of the various disclosed embodiments described above and / or other desired functions. In one example, the electronic device can further include: an input device 603 and an output device 604, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0144] In addition, the input device 603 can further include, for example, a keyboard, a mouse, etc. The output device 604 can output various information to the outside. The output device 604 can include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0145] Of course, for simplicity, Figure 6 only some of the components related to the present disclosure in the electronic device are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device can further include any other appropriate components.

[0146] Exemplary computer program product and computer-readable storage medium

[0147] In addition to the above methods and devices, the embodiments of the present disclosure can also be computer program products, which include computer program instructions that, when run by a processor, cause the processor to execute the steps in the website internal link generation method according to various embodiments of the present disclosure described in the "Exemplary Method" section above in this specification.

[0148] The computer program product may be written in any combination of one or more programming languages for executing the program code of the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0149] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are run by a processor, the processor is caused to execute the steps in the website internal link generation method according to various embodiments of the present disclosure described in the "Exemplary Method" section above of this specification.

[0150] The computer-readable storage medium may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0151] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, advantages, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, advantages, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-mentioned specific details are only for the purpose of illustration and facilitation of understanding, and are not limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0152] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference may be made to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant parts, reference may be made to the description of the method embodiment.

[0153] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The words "or" and "and" used herein refer to the phrase "and / or", and can be used interchangeably with it, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to", and can be used interchangeably with it.

[0154] The methods and apparatuses of the present disclosure can be implemented in many ways. For example, the methods and apparatuses of the present disclosure can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of the steps for the method is only for illustration, and the steps of the method of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure can also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0155] It should also be noted that in the apparatuses, equipment, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

[0156] The above description has been given for purposes of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions, and sub-combinations thereof.

Claims

1. A method for generating internal links within a website, characterized in that, The method includes: Generating N data number ranges, where: Generating N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting number values of the data numbers included in the N data number ranges are all 1, and the ending number values are all C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page; or Generating N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting number value of the data numbers included in the nth data number range is (n - 1)*C + 1, and the ending number value is n*C, where C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page, and 1 ≤ n ≤ N; Randomly extracting 1 data number from each of the N data number ranges, and generating an object to be verified with a bit storage structure according to the N extracted data numbers, including: In the database redis, storing the N data number ranges in a key-value structure. Among them, when the starting number values of the data numbers included in the N data number ranges are all 1 and the ending number values are all C, the key value of each data number range is the number n of the data number range, and the value value is 1; when the starting number value of the data numbers included in the nth data number range is (n - 1)*C + 1 and the ending number value is n*C, the key value of the nth data number range is n, and the value value is (n - 1)*C + 1; Randomly extracting 1 data number from each of the N pre-set data number ranges; Combining the N extracted data numbers to generate an object with a bit storage structure as the object to be verified, and saving the object to be verified in the form of a java object; When the object to be verified is not repeated with the objects that have been verified in the object storage space, saving the object to be verified as a verified object to the object storage space; Retrieving the corresponding data sources in the data source storage space according to the N extracted data numbers, and generating N internal link links displayed on a single website page.

2. The method according to claim 1, characterized in that, When the object to be verified is not repeated with the objects that have been verified in the object storage space, saving the object to be verified as a verified object to the object storage space includes: When the object storage space is the database redis, when it is determined by sismember that the object to be verified does not exist, then the object to be verified is not repeated with the objects that have been verified in redis, and the object to be verified is stored in redis.

3. The method according to claim 2, wherein When the data structure of the object to be verified is a bitset structure, storing the object to be verified in redis using a set structure.

4. The method according to claim 1, wherein Retrieving the corresponding data sources in the data source storage space according to the N extracted data numbers, and generating N internal link links displayed on a single website page includes: Determining N primary key ID values according to the N extracted data numbers; Retrieving the corresponding N data sources in the data source storage space according to the N primary key ID values; Generate N internal link URLs based on the N data sources retrieved by the search.

5. The method according to claim 4, wherein Determining the N primary key ID values according to the N data numbers extracted includes: When the starting value of the data numbers included in the nth data number range among the N data number ranges is (n - 1)*C + 1 and the ending value is n*C, the values of the N data numbers are the N primary key ID values; When the starting value of the data numbers included in the N data number ranges is 1 and the ending value is C, the calculation formula for the nth primary key ID value among the N primary key ID values is: IDn = (n - 1)*C + Dn where 1 ≤ n ≤ N, 1 ≤ Dn ≤ C, and Dn is the value of the data number extracted from the nth data number range.

6. A device for generating internal links within a website, characterized in that, The device includes: An interval numbering module for generating N data number ranges, where: Generate N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting value of the data numbers included in the N data number ranges is 1, and the ending value is C. C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page; or Generate N data number ranges according to the number N of data sources displayed on each page of the website. Among them, the starting value of the data numbers included in the nth data number range is (n - 1)*C + 1, and the ending value is n*C. C is calculated according to the magnitude T of the data sources that can be displayed on the website and the number N of data sources displayed on each page, 1 ≤ n ≤ N; A data string module for randomly extracting 1 data number from each of the N data number ranges and generating a verification object with a bit storage structure according to the N data numbers extracted, including: In the database redis, store the N data number ranges in a key - value structure. Among them, when the starting value of the data numbers included in the N data number ranges is 1 and the ending value is C, the key value of each data number range is the number n of the data number range, and the value value is 1; when the starting value of the data numbers included in the nth data number range is (n - 1)*C + 1 and the ending value is n*C, the key value of the nth data number range is n, and the value value is (n - 1)*C + 1; Randomly extract 1 data number from each of the N pre - set data number ranges; Combine the N data numbers extracted to generate an object with a bit storage structure as the verification object and save the verification object in the form of a java object; A data verification module for saving the verification object as a verified object in the object storage space when the verification object does not repeat with the objects that have been verified in the object storage space; An internal link generation module for retrieving the corresponding data sources in the data source storage space according to the N data numbers extracted and generating the N internal link URLs displayed on a single website page.

7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is used to execute the method according to any one of the above claims 1-5.

8. An electronic device, characterized in that, The electronic device includes: a processor; a memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any one of the above claims 1-5.

Citation Information

Patent Citations

  • Product-line based content management system and method thereof

    CN102054219A

  • Data storage method and device

    CN103678293A